git.iko.soy/rowtype-yoga/purescript-native
on 4149729 help sign in
43 lines 961 B history raw
1-----------------------------------------------------------------------------
2--
3-- Module : Purescript.Types
4-- Copyright : (c) Phil Freeman 2013
5-- License : MIT
6--
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
9-- Portability :
10--
11-- |
12--
13-----------------------------------------------------------------------------
15{-# LANGUAGE DeriveDataTypeable #-}
17module PureScript.Types where
19import Data.Data
21data Type
22 = TUnknown Int
23 | Number
24 | String
25 | Boolean
26 | Array Type
27 | Object Row
28 | Function [Type] Type
29 | TypeVar String
30 | TypeConstructor String
31 | TypeApp Type Type
32 | SaturatedTypeSynonym String [Type] deriving (Show, Eq, Data, Typeable)
34data PolyType = PolyType [String] Type deriving (Show, Eq, Data, Typeable)
36data Row
37 = RUnknown Int
38 | RowVar String
39 | REmpty
40 | RCons String Type Row deriving (Show, Eq, Data, Typeable)
42monoType :: Type -> PolyType
43monoType = PolyType []