forked from github/purescript-typeable
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.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
module Test.Person where
|
||||
|
||||
import Data.Typeable (class TagT, TypeRep, proxyT, typeRep)
|
||||
import Data.Typeable (class Tagged, TypeRep, makeTag, typeRep)
|
||||
import Data.Unit (unit)
|
||||
|
||||
newtype Person = Person { name :: String, location :: String }
|
||||
|
||||
instance tagTPerson :: TagT Person where
|
||||
tagT = proxyT
|
||||
instance taggedPerson :: Tagged Person where
|
||||
tag = makeTag unit
|
||||
|
||||
typePerson :: TypeRep Person
|
||||
typePerson = typeRep
|
||||
|
||||
Reference in New Issue
Block a user