]> Git — Sourcephile - haskell/symantic.git/blob - Language/Symantic/Type/List.hs
init
[haskell/symantic.git] / Language / Symantic / Type / List.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE TypeFamilies #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Language.Symantic.Type.List where
6
7 import Data.Proxy
8
9 import Language.Symantic.Type.Common
10
11 -- * Type 'Type_List'
12 -- | The list type.
13 type Type_List = Type_Type1 []
14
15 instance -- String_from_Type
16 String_from_Type root =>
17 String_from_Type (Type_List root) where
18 string_from_type (Type_Type1 _f a) =
19 "[" ++ string_from_type a ++ "]"
20
21 -- | Inject a 'Type_List' within a root type.
22 type_list
23 :: Lift_Type_Root Type_List root
24 => root h_a
25 -> root ([] h_a)
26 type_list = lift_type_root . Type_Type1 (Proxy::Proxy [])