Hi, all! I guess what I am about to ask is currently impossible, but as
you haskellers always manage to amaze me here it goes. Given two type
classes A t and B t, I'd like to derive (two) different A t instances
depending exactly on whether t is an instance of B. In other words, is it
possible
Andrew Coppin escreveu:
...yep, configure fails because it can't find sh. (Again.)
You are probably not using cygwin, are you? I mean, it includes sh and
should get you going. Just make sure to check all you need in the cygwin
setup.
Cheers,
Jorge.
Adapting my previous class sample with these ideas, we have:
class Multicompose t1 t2 t3 | t1 t2 - t3 where
infixr 9 +.
(+.)::t1 - t2 - t3
instance Multicompose t1 t2 t3 = Multicompose t1 (a - t2) (a - t3) where
(+.) = (.).(+.)
instance Multicompose (b - c) (a - b) (a -
Here is a generalized version, using type classes and some extensions.
Tiago, in order to compile this you'll have to use:
-fglasgow-exts -fallow-undecidable-instances -fallow-overlapping-instances
Cheers,
Jorge.
-
module Main where
class Pipeline t1 t2 t3 | t1 t2 - t3 where
Hi, all!
This is a newbie question: I sort of understand what unsafePerformIO does
but I don't quite get its consequences. In short: how safe can one be in
face of it? I mean, conceptually, it allows any Haskell function to have
side effects just as in any imperative language, doesn't it?
Thanks! That's very clarifying.
Bulat Ziganshin escreveu:
Hello Jorge,
Wednesday, September 26, 2007, 6:43:15 PM, you wrote:
This is a newbie question: I sort of understand what unsafePerformIO
does
but I don't quite get its consequences. In short: how safe can one be in
face of it?
i