Unfortunately I do not know the fancy Haskell type-level stuff, but if I was looking at this same problem, I'd think you need a sum type:

data Unchecked = Unchecked String
data Checked = Hd5 String | Cbf String

check :: Unchecked -> Checked

There is likely a better concept than "Checked" in your domain. I do not know what those things represent, but I would use that ubiquitous language instead - i.e., data Image ... instead of Checked. 



On Tue, Oct 2, 2018 at 12:05 PM PICCA Frederic-Emmanuel <frederic-emmanuel.picca@synchrotron-soleil.fr> wrote:
> I believe you can do this with GADTs [1]

I can create different constructors for the different types.
but how can I create a function which return different type ?


Fred
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


--
Steven Leiva
305.528.6038
leiva.steven@gmail.com
http://www.linkedin.com/in/stevenleiva