1 {-# LANGUAGE DefaultSignatures #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE ScopedTypeVariables #-}
4 {-# LANGUAGE TypeFamilies #-}
5 {-# LANGUAGE TypeOperators #-}
6 -- | Expression for 'Integer'.
7 module Language.Symantic.Expr.Integer where
9 import qualified Data.Text as Text
11 import Language.Symantic.Type
12 import Language.Symantic.Repr
13 import Language.Symantic.Expr.Root
14 import Language.Symantic.Expr.Error
15 import Language.Symantic.Expr.From
16 import Language.Symantic.Trans.Common
20 class Sym_Integer repr where
21 integer :: Integer -> repr Integer
22 default integer :: Trans t repr => Integer -> t repr Integer
23 integer = trans_lift . integer
24 instance Sym_Integer Repr_Host where
26 instance Sym_Integer Repr_Text where
27 integer a = Repr_Text $ \_p _v ->
32 ) => Sym_Integer (Repr_Dup r1 r2) where
33 integer x = integer x `Repr_Dup` integer x
35 -- * Type 'Expr_Integer'
37 data Expr_Integer (root:: *)
38 type instance Root_of_Expr (Expr_Integer root) = root
39 type instance Type_of_Expr (Expr_Integer root) = Type_Integer
40 type instance Sym_of_Expr (Expr_Integer root) repr = Sym_Integer repr
41 type instance Error_of_Expr ast (Expr_Integer root) = No_Error_Expr