[Haskell-beginners] Tagged types

Francesco Ariis fa-ml at ariis.it
Tue Oct 2 16:56:48 UTC 2018


Hello Frederic,

On Tue, Oct 02, 2018 at 04:48:09PM +0000, PICCA Frederic-Emmanuel wrote:
> So I would like a function which allow to return a A Hdf5 or a A Cbf depending on the String content.
> 
> check :: A Unchecked -> A ???
> check = ???
> 
> Is it possible to do this ?

I believe you can do this with GADTs [1]

[1] https://en.wikibooks.org/wiki/Haskell/GADT


More information about the Beginners mailing list