Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Fwd: ANNOUNCE : leksah-0.10.0 rpms available for Fedora 14
([email protected])
2. Help with type declaration using MArray (Perry James)
3. Re: Help with type declaration using MArray (Daniel Fischer)
----------------------------------------------------------------------
Message: 1
Date: Sun, 17 Apr 2011 18:25:16 +0530
From: "[email protected]" <[email protected]>
Subject: [Haskell-beginners] Fwd: ANNOUNCE : leksah-0.10.0 rpms
available for Fedora 14
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
leksah-0.10.0 rpms available for Fedora 14
x86:
Download this script
install_x86.sh<http://narasim.fedorapeople.org/leksah/f14/i686/install_x86.sh>
Open command line, cd into the folder where the script is downloaded. Type
in the following command
]$ chmod u+x install_x86.sh
Become root,
]$ su
password:
]$ ./install_x86.sh
x86_64:
Download this script
install_x86_64.sh<http://narasim.fedorapeople.org/leksah/f14/x86_64/install_x86_64.sh>
Open command line, cd into the folder where the script is downloaded. Type
in the following command
]$ chmod u+x install_x86_64.sh
Become root,
]$ su
password:
]$ ./install_x86_64.sh
The rpms can be found at this location,
http://narasim.fedorapeople.org/leksah/f14/. The script runs yum internally.
-
Lakshmi Narasimhan T V
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110417/44abdcc9/attachment-0001.htm>
------------------------------
Message: 2
Date: Sun, 17 Apr 2011 22:38:17 -0400
From: Perry James <[email protected]>
Subject: [Haskell-beginners] Help with type declaration using MArray
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi all,
I'm working through Brown & Cook's "Monadic Memoization Mixins" and have
come across some code that I can't get to compile with GHC.
The error I get for
arrayDict :: (*MArray *arr (*Maybe *b) m, *Ix *a, *Ord *a)
=> a -> arr a (*Maybe *b) -> *Dict *a b m
is
Non type-variable argument
in the constraint: MArray arr (Maybe b) m
(Use -XFlexibleContexts to permit this)
In the type signature for `arrayDict':
arrayDict :: (MArray arr (Maybe b) m, Ix a, Ord a) =>
a -> arr a (Maybe b) -> Dict a b m
Enabling FlexibleContexts causes other errors. What could be going wrong?
In case this isn't enough context, I've posted the full source code for this
section of the paper at
smipple<http://www.smipple.net/snippet/Perry%20James/Monadic%20Memoization%20Mixins>
.
Thanks in advance for any help,
Perry
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110417/13da08f6/attachment-0001.htm>
------------------------------
Message: 3
Date: Mon, 18 Apr 2011 05:00:17 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Help with type declaration using
MArray
To: [email protected]
Message-ID: <[email protected]>
Content-Type: Text/Plain; charset="utf-8"
On Monday 18 April 2011 04:38:17, Perry James wrote:
> Hi all,
>
> I'm working through Brown & Cook's "Monadic Memoization Mixins" and have
> come across some code that I can't get to compile with GHC.
>
> The error I get for
>
> arrayDict :: (*MArray *arr (*Maybe *b) m, *Ix *a, *Ord *a)
> => a -> arr a (*Maybe *b) -> *Dict *a b m
>
> is
> Non type-variable argument
> in the constraint: MArray arr (Maybe b) m
> (Use -XFlexibleContexts to permit this)
> In the type signature for `arrayDict':
> arrayDict :: (MArray arr (Maybe b) m, Ix a, Ord a) =>
> a -> arr a (Maybe b) -> Dict a b m
That's clear enough, I think, you have to enable FlexibleContexts.
(Btw, also NPlusKPatterns for newer GHCs.)
>
> Enabling FlexibleContexts causes other errors. What could be going
> wrong? In case this isn't enough context, I've posted the full source
> code for this section of the paper at
> smipple<http://www.smipple.net/snippet/Perry%20James/Monadic%20Memoizati
> on%20Mixins> .
Simple, lines 80-81:
arrayDict size arr = (check, store) where
check a = if a > size then return Nothing
else return readArray arr a
readArray array index :: monad (Maybe b)
so the return in the else branch shouldn't be. Remove it and it compiles.
>
> Thanks in advance for any help,
> Perry
Cheers,
Daniel
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 34, Issue 30
*****************************************