purescript-typeable/test/Person.purs
Anupam Jain f3dd0c0fb1 Reduce dependence on the internal dictionary passing mechanism
Part of this work was done by @the-dr-lazy in
https://github.com/ajnsit/purescript-typeable/pull/3.

GOOD:
Now there is no more dependence on dictionaries being passed as function
arguments at runtime.

BAD:
1. However, we still depend on the dictionaries being stable at runtime.
2. We now also assume that the output of the new function `makeTag` will
never be cached.
2023-07-06 20:51:50 +05:30

17 lines
361 B
Haskell

module Test.Person where
import Data.Typeable (class Tagged, TypeRep, makeTag, typeRep)
import Data.Unit (unit)
newtype Person = Person { name :: String, location :: String }
instance taggedPerson :: Tagged Person where
tag = makeTag unit
typePerson :: TypeRep Person
typePerson = typeRep
typeArrPerson :: TypeRep (Array Person)
typeArrPerson = typeRep