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