git.iko.soy/rowtype-yoga/purescript-native
on 2ffe085 help sign in
42 lines 918 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 deriving (Show, Eq, Data, Typeable)
33data PolyType = PolyType [String] Type deriving (Show, Data, Typeable)
35data Row
36 = RUnknown Int
37 | RowVar String
38 | REmpty
39 | RCons String Type Row deriving (Show, Eq, Data, Typeable)
41monoType :: Type -> PolyType
42monoType = PolyType []