[Haskell-cafe] reifying is-a

2008-01-06 Thread Jorge Marques Pelizzoni
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

Re: [Haskell-cafe] libSDL [Tetris]

2007-11-21 Thread Jorge Marques Pelizzoni
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.

Re: [Haskell-cafe] Re: Function composition

2007-10-04 Thread Jorge Marques Pelizzoni
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 -

Re: [Haskell-cafe] Function composition

2007-10-03 Thread Jorge Marques Pelizzoni
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

[Haskell-cafe] unsafePerformIO: are we safe?

2007-09-26 Thread Jorge Marques Pelizzoni
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?

Re: [Haskell-cafe] unsafePerformIO: are we safe?

2007-09-26 Thread Jorge Marques Pelizzoni
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