[Haskell-cafe] Re: Rigid types fun
Hello Mitar, Friday, November 5, 2010, 12:45:21 PM, you wrote: from - newChan for - newChan let nerve = Nerve (Axon from) (AxonAny for) create = do from - newChan for - newChan return$ Nerve (Axon from) (AxonAny for) main = do nerve - create ... -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Rigid types fun
Hi! On Fri, Nov 5, 2010 at 10:49 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Friday, November 5, 2010, 12:45:21 PM, you wrote: from - newChan for - newChan let nerve = Nerve (Axon from) (AxonAny for) create = do from - newChan for - newChan return$ Nerve (Axon from) (AxonAny for) main = do nerve - create ... OK. It is necessary to check the attached file to understand. ;-) I would like to call it like create (Axon undefined) (AxonAny undefined) and get in that case Nerve (Axon a) (AxonAny b) as a result. If I would call it like create (AxonAny undefined) (AxonAny undefined) I would get Nerve (AxonAny a) (AxonAny b) as a result. And so on. So I know I can move some hard-coded combination into a function. But I would like to cover all combinations and tell with arguments which combination I want. Mitar ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Rigid types fun
On 05.11.2010 14:08, Mitar wrote: So I know I can move some hard-coded combination into a function. But I would like to cover all combinations and tell with arguments which combination I want. I'm not sure what do you exactly want. But what about applicative functors? They offer nice notation Nerve $ (Axon $ newChan) * (AxonAny $ newChan) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Rigid types fun
Hi! On Fri, Nov 5, 2010 at 12:50 PM, Alexey Khudyakov alexey.sklad...@gmail.com wrote: I'm not sure what do you exactly want. But what about applicative functors? They offer nice notation Nerve $ (Axon $ newChan) * (AxonAny $ newChan) Ooo. That is nice. Mitar ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe