Can you have Typeable as an extra constraint? If so:
{-# LANGUAGE ExistentialQuantification #-}
import Data.Typeable
data Baz = forall a. (Eq a, Typeable a) = Baz a
instance Eq Baz where
Baz x == Baz y =
case cast y of
Just y' - x == y'
Nothing - False
ghci Baz
2009/10/8 Andrew U. Frank fr...@geoinfo.tuwien.ac.at:
i have a strange error, which does not occur when i run
runghc Setup.lhs configure
but when i use cabal configure and then build, it occurs.
the error is
Type constructor Control.Exception.Exception used as a class
in the instance
2009/9/27 Paul Moore p.f.mo...@gmail.com:
I'm still playing round with my random dieroll generation program. In
doing so, I just hit a segmentation fault (I didn't think Haskell
could *cause* a segfault!) I'm sure it's my code - I got this to
compile by fiddling with types until the errors
2009/8/5 xu zhang douy...@gmail.com:
Hi there,
If I import a module and do not explicitly point out the entities I have
imported. And I want the ghc to point out the entities automatically. Is
there any method to do this? any methods to have the ghc point out the
entities I import and
2009/5/1 Paul Keir pk...@dcs.gla.ac.uk:
There's nothing better than making a data type an instance of Num. In
particular, fromInteger is a joy. But how about lists?
For example, if I have
data Foo a = F [a]
I can create a fromInteger such as
fromInteger i = F [fromInteger i]
and then a
2009/4/28 Tuve Nordius t...@student.chalmers.se:
If I for some data type wants to derive, in this case Data and Typeable for
use with syb code, but the problem is the same regardless what I want to
derive.
data family Something
data Tree = Leaf Something | Fork Something Tree Tree
2009/4/22 michael rice nowg...@yahoo.com:
Just exploring. How to load?
Michael
[mich...@localhost ~]$ ghci Data.Complex
GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading
2009/4/4 gwe...@gmail.com:
So some time ago I saw mentioned the game of Zendo
https://secure.wikimedia.org/wikipedia/en/wiki/Zendo_(game) as a good game
for programmers to play (and not just by Okasaki). The basic idea of Zendo
is that another player is creating arrangements of little colored
2009/4/2 Henry Laxen nadine.and.he...@pobox.com:
Dear Group,
I'm trying to read the paper:
Functional Pearl: Implicit Configurations
at http://www.cs.rutgers.edu/~ccshan/prepose/
and when running the code in prepose.lhs I get:
../haskell/prepose.lhs:707:0: Parse error in pattern
which is
2009/3/13 Martijn van Steenbergen mart...@van.steenbergen.nl:
Hello,
Looking at Parsec 3 I see:
chainr1 :: (Stream s m t) = ParsecT s u m a -
ParsecT s u m (a - a - a) - ParsecT s u m a
chainr1 p op = scan where
scan = do x - p; rest x
rest x = (do f - op; y - scan; return (f
2009/3/13 Pavel Perikov peri...@gmail.com:
Hi café !
I googled for some kind of vim support for cabal but found nothing. I mean
syntax highlighting of .cabal and probably integration with haskellmode. Did
anyone hear about such thing?
Pavel
I've been wanting something like this as well,
If you don't mind using GHC extensions (which in a view pattern thread
probably isn't much of a stretch to assume :) ), there's always record
punning (-XNamedFieldPuns):
data Foo = { [snip] }
f (Foo { a, g }) = ...
2009/1/15 John Van Enk vane...@gmail.com:
I've often thought having
12 matches
Mail list logo