Hi,
While playing with type families in GHC 6.10.1, I guess I bumped into
the no-overlap restriction. As I couldn't find any examples on that, I
include the following (non-compiling) code so as to check with you if
that's really the case:
---
{-# OPTIONS
Hi, all! I guess this belongs to haskell-cafe or glasgow-haskell-users,
but I've already been there and got no replies. Thanks in advance for
anyone taking the time to read on.
Given two type classes A t and B t, I'd like the typechecker to derive
different A t instances depending exactly on
Thank you very much, Ralf, for your very thorough reply. That's a very
general way to deal with the issue. It never occurred to me that the
inspected class itself might carry the availability info.
Cheers,
Jorge.
Ralf Laemmel escreveu:
Given two type classes A t and B t, I'd like the
Hi, all! I guess what I am about to ask is currently impossible, but as
you haskellers always manage to amaze me and there is plenty of new
features in GHC I am not familiar with here it goes. Given two type
classes A t and B t, I'd like to derive different A t instances
depending exactly on
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
instance Show WeekDay where
(empty)
You see, an empty instance like that may serve various purposes. In
type-level programming, for example, they (roughly) correspond to facts in
logic programming. However, in the case at hand, this is what happens: the
doc for class Show reads thus:
Minimal
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.
Assunto: undecidable overlapping instances: a bug?
De: Jorge Marques Pelizzoni [EMAIL PROTECTED]
Data:Sab, Outubro 13, 2007 5:59 am
Para:GHC users [EMAIL PROTECTED]
--
Hi, all!
I am quite intrigued
Hi, all!
I am quite intrigued at the behaviour examplified in the attached module.
It's true I am a newbie and probably don't quite get the whole consequence
spectrum of -fallow-undecidable-instances, but why providing that dummy
instance (commented out) get the thing to compile?
By the way, I'm
Hi, all!
It may be a side-effect of being a newbie, but many times I find the
-fno-monomorphism-restriction quite handy. Is it intrinsically evil? I
mean, has anyone had a bad time using it or does it imply some runtime
performance overhead? I guess it is not portable, is it?
Thanks in advance.
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
14 matches
Mail list logo