Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 6bdf1ab879
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (50 sloc) 1.73 KB
{-# LANGUAGE TemplateHaskell #-}
module SchemaTypes where
import Schema
import Data.Aeson
-- collections
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.HashSet as HashSet
import qualified Data.IntSet as IntSet
import qualified Data.Vector as Vector
-- primitives
import Data.Word
import Data.Int
import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB
import qualified Data.Text as T
import qualified Data.Text.Lazy as LT
import Language.Haskell.TH.Syntax
-- for primitives that map to primitive js types
mapNamePrimTyp :: Map.Map Name PrimType
= Map.fromList [ (''String, Str)
, (''Char, Str)
, (''T.Text, Str)
, (''LT.Text, Str)
, (''B.ByteString, Str)
, (''LB.ByteString, Str)
, (''Int, Num)
, (''Integer, Num)
, (''Word64, Num)
, (''Word32, Num)
, (''Word16, Num)
, (''Word8, Num)
, (''Word, Num)
, (''Int64, Num)
, (''Int32, Num)
, (''Int16, Num)
, (''Int8, Num)
, (''Object, Obj)
, (''Bool, Boolean)
-- collections that map to []
setRepTyp :: Set.Set Name
= Set.fromList [ ''Set.Set
, ''HashSet.HashSet
, ''IntSet.IntSet
, ''Vector.Vector
, ''[]
Jump to Line
Something went wrong with that request. Please try again.