[Haskell-cafe] Read Instance for UArray won't port to linux
sdowney at gmail.com
Wed Mar 14 23:42:22 EDT 2007
It's not just type variables. Type classes looked innocent, but
smuggled an entire turing complete generic meta computation system
into the language. Just thank SIMON that the error messages aren't as
bad as C++ and templates.
This does imply that mOleg have some equivalence relation to uAlexanrescue
On 3/14/07, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello SevenThunders,
> Wednesday, March 14, 2007, 10:32:23 PM, you wrote:
> the type variables are dark side of GHC, and you need to have at least
> 1 mlOleg of brain to understand them. it will be great if someone will
> ever write reasonable introduction into this. meanwhile, you can look
> into ghc docs
> > You guys are awesome! I post this not 12 hours ago and I already have a
> > complete treatise on the subject. Yeah to clarify things putting an
> > ellipsis between b and c would help. But also clarify the meaning of
> > distinct type variables. Does this mean the type variable must not be
> > parameterized?
> > I ran into this because I decided during my port that I would try to learn
> > some of the better build tools on linux. So now I'm acquainted with
> > which is a great tool and cabal which is also very impressive. My problem
> > boiled down to the fact that I didn't know how to set the correct compiler
> > flags within cabal. I figured out the FFI flags and now I suppose the gch
> > extensions can be set with Ghc-options: -fglasgow-exts in my .cabal file.
> > there a type in the Extensions field that corresponds to this?
> > Spencer Janssen-2 wrote:
> >> It looks like you forgot to pass a compiler flag, namely -fglasgow-exts.
> >> Cheers,
> >> Spencer Janssen
> >> On Tue, 13 Mar 2007 22:20:20 -0700 (PDT)
> >> SevenThunders <mattcbro at earthlink.net> wrote:
> >>> I have the pleasure of porting a good sized Haskell application to
> >>> linux. So far the Haskell code has compiled without incident, however
> >>> some code that I hacked
> >>> to implement a Read instance for Unboxed Arrays does not compile on
> >>> linux even though it compiles just fine on Windows XP in Haskell 6.6.
> >>> The code reads as,
> >>> instance Read (UArray Int Double) where
> >>> readsPrec p = readParen (p > 9)
> >>> (\r -> [(array b as :: UArray Int Double, u) | ("array",s)
> >>> <- lex r,
> >>> (b,t) <- reads s,
> >>> (as,u) <- reads t ])
> >>> The error in linux is:
> >>> Illegal instance declaration for `Read (UArray Int Double)'
> >>> (The instance type must be of form (T a b c)
> >>> where T is not a synonym, and a,b,c are distinct type
> >>> variables) In the instance declaration for `Read (UArray Int Double)'
> >>> Why does it want three parameters for the instance type? I am
> >>> baffled by this.
> >> _______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-Cafe at haskell.org
> >> http://www.haskell.org/mailman/listinfo/haskell-cafe
> Best regards,
> Bulat mailto:Bulat.Ziganshin at gmail.com
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe