0 | ||| This provides `Lit` implementations for the types from the
 1 | ||| prelude. If you import this, make sure to add the following
 2 | ||| pragmas to the top of your source files:
 3 | |||
 4 | ||| ```idris
 5 | ||| %hide Builtin.fromString
 6 | ||| %hide Builtin.fromChar
 7 | ||| %hide Builtin.fromInteger
 8 | ||| %hide Builtin.fromDouble
 9 | ||| ```
10 | |||
11 | ||| Even then, you might experience some interference when using
12 | ||| other libraries or data types. Only use if you know what you
13 | ||| are doing.
14 | module Literal.Prelude
15 |
16 | import public Literal
17 |
18 | %default total
19 |
20 | public export %hint
21 | stringLitImpl : StringLit String
22 | stringLitImpl = slPlain id
23 |
24 | public export %hint
25 | charLitImpl : CharLit Char
26 | charLitImpl = clPlain id
27 |
28 | public export %hint
29 | doubleLitImpl : DoubleLit Double
30 | doubleLitImpl = dlPlain id
31 |
32 | public export %hint
33 | integerLitImpl : IntegerLit Integer
34 | integerLitImpl = ilPlain id
35 |
36 | public export %hint
37 | intLitImpl : IntegerLit Int
38 | intLitImpl = ilPlain prim__cast_IntegerInt
39 |
40 | public export %hint
41 | natLitImpl : IntegerLit Nat
42 | natLitImpl = ilPlain integerToNat
43 |
44 | public export %hint
45 | bits8LitImpl : IntegerLit Bits8
46 | bits8LitImpl = ilPlain prim__cast_IntegerBits8
47 |
48 | public export %hint
49 | bits16LitImpl : IntegerLit Bits16
50 | bits16LitImpl = ilPlain prim__cast_IntegerBits16
51 |
52 | public export %hint
53 | bits32LitImpl : IntegerLit Bits32
54 | bits32LitImpl = ilPlain prim__cast_IntegerBits32
55 |
56 | public export %hint
57 | bits64LitImpl : IntegerLit Bits64
58 | bits64LitImpl = ilPlain prim__cast_IntegerBits64
59 |
60 | public export %hint
61 | int8LitImpl : IntegerLit Int8
62 | int8LitImpl = ilPlain prim__cast_IntegerInt8
63 |
64 | public export %hint
65 | int16LitImpl : IntegerLit Int16
66 | int16LitImpl = ilPlain prim__cast_IntegerInt16
67 |
68 | public export %hint
69 | int32LitImpl : IntegerLit Int32
70 | int32LitImpl = ilPlain prim__cast_IntegerInt32
71 |
72 | public export %hint
73 | int64LitImpl : IntegerLit Int64
74 | int64LitImpl = ilPlain prim__cast_IntegerInt64
75 |