{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleContexts #-}
module Data.Generics.Builders (empty, constrs) where
import Data.Data
import Data.Generics.Aliases (extB)
empty :: forall a. Data a => a
empty = general
`extB` char
`extB` int
`extB` integer
`extB` float
`extB` double where
general :: Data a => a
general = fromConstrB empty (indexConstr (dataTypeOf general) 1)
char = '\NUL'
int = 0 :: Int
integer = 0 :: Integer
float = 0.0 :: Float
double = 0.0 :: Double
constrs :: forall a. Data a => [a]
constrs = general
`extB` char
`extB` int
`extB` integer
`extB` float
`extB` double where
general :: Data a => [a]
general = map (fromConstrB empty)
(dataTypeConstrs (dataTypeOf (unList general))) where
unList :: Data a => [a] -> a
unList = undefined
char = "\NUL"
int = [0 :: Int]
integer = [0 :: Integer]
float = [0.0 :: Float]
double = [0.0 :: Double]