ekmett / tagged

phantom types
http://hackage.haskell.org/package/tagged
BSD 3-Clause "New" or "Revised" License
37 stars 26 forks source link

Request: proxyOf :: a -> Proxy a #15

Closed jberryman closed 10 years ago

jberryman commented 10 years ago

Similar to #12 (which I haven't wanted yet), but I defined this first thing when starting to use tagged

proxyOf :: a -> Proxy a
proxyOf _ = Proxy

Please let me know if I'm missing something obvious.

Also, random thought re. naming, inspired by asTypeOf but with some reified notion of the type or something.

as :: a -> Proxy a -> a
typeOf :: a -> Proxy a
shachaf commented 10 years ago

Do you have a particular use case where pure/return doesn't work?

jberryman commented 10 years ago

Ah, that was the something obvious I was missing, sorry :)