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. Encoding strings (legajid)
2. Re: Encoding strings (aditya siram)
3. Re: Encoding strings (Daniel Fischer)
4. Adding module ([email protected])
5. Re: Adding module (??????? ?????????)
6. Re: Adding module (Felipe Lessa)
7. Map on Nested Lists (Ben Derrett)
8. Re: Map on Nested Lists (matthew coolbeth)
9. Re: Map on Nested Lists (Thomas Davie)
----------------------------------------------------------------------
Message: 1
Date: Wed, 07 Apr 2010 22:39:39 +0200
From: legajid <[email protected]>
Subject: [Haskell-beginners] Encoding strings
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi,
i experiment problems writing files.
Reading an access 97 database and displaying data in a wxhaskell grid,
everything is correct.
When i write data in a text file, some characters are translated : "é"
becomes \233.
How to correct this ?
I looked for hSetEncoding but didn't find it in System.IO, nor in
GHC.IO.Handle that doesn't exist on my system.
I tried hSetBinaryMode, without success.
If this helps, I run ghc 6.10.4 on windows XP.
Thanks for an idea,
Didier.
------------------------------
Message: 2
Date: Wed, 7 Apr 2010 15:49:10 -0500
From: aditya siram <[email protected]>
Subject: Re: [Haskell-beginners] Encoding strings
To: legajid <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
This is because of Unicode strings. You need to import
"Codec.Binary.UTF8.String" and use:
decodeString :: String -> String
and
encodeString :: String -> String
hth,
deech
On 4/7/10, legajid <[email protected]> wrote:
> Hi,
>
> i experiment problems writing files.
> Reading an access 97 database and displaying data in a wxhaskell grid,
> everything is correct.
> When i write data in a text file, some characters are translated : "é"
> becomes \233.
>
> How to correct this ?
> I looked for hSetEncoding but didn't find it in System.IO, nor in
> GHC.IO.Handle that doesn't exist on my system.
> I tried hSetBinaryMode, without success.
>
> If this helps, I run ghc 6.10.4 on windows XP.
>
> Thanks for an idea,
> Didier.
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
------------------------------
Message: 3
Date: Wed, 7 Apr 2010 22:45:57 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Encoding strings
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Mittwoch 07 April 2010 22:39:39 schrieb legajid:
> Hi,
>
> i experiment problems writing files.
> Reading an access 97 database and displaying data in a wxhaskell grid,
> everything is correct.
> When i write data in a text file, some characters are translated : "é"
> becomes \233.
>
> How to correct this ?
> I looked for hSetEncoding but didn't find it in System.IO, nor in
> GHC.IO.Handle that doesn't exist on my system.
> I tried hSetBinaryMode, without success.
Try
import qualified System.IO.UTF8 as U
and replace
putStrLn, hPutStrLn, writeFile, appendFile, ...
with U.putStrLn, U.hPutStrLn, ...
>
> If this helps, I run ghc 6.10.4 on windows XP.
>
> Thanks for an idea,
> Didier.
>
------------------------------
Message: 4
Date: Thu, 8 Apr 2010 11:54:50 +0200 (CEST)
From: [email protected]
Subject: [Haskell-beginners] Adding module
To: beginners <[email protected]>
Message-ID:
<63008433.6504291270720490574.javamail.r...@zimbra10-e2.priv.proxad.net>
Content-Type: text/plain; charset=utf-8
Hi,
i need the System.IO.UTF8 module.
But it is not in my installation package (windows xp, ghc 6.10.4); i can't
import it, nor display html help about it.
Where to find and how to install it ?
Thanks,
Didier.
------------------------------
Message: 5
Date: Thu, 8 Apr 2010 14:09:37 +0400
From: ??????? ????????? <[email protected]>
Subject: Re: [Haskell-beginners] Adding module
To: [email protected]
Cc: beginners <[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
This module is in the package utf8-string. Try installing it using Cabal. Or
you can just download it from here:
http://hackage.haskell.org/package/utf8-string-0.3.6, and build.
On Thu, Apr 8, 2010 at 1:54 PM, <[email protected]> wrote:
> Hi,
>
> i need the System.IO.UTF8 module.
> But it is not in my installation package (windows xp, ghc 6.10.4); i can't
> import it, nor display html help about it.
> Where to find and how to install it ?
>
> Thanks,
> Didier.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100408/8cbdfc3c/attachment-0001.html
------------------------------
Message: 6
Date: Thu, 8 Apr 2010 07:50:12 -0300
From: Felipe Lessa <[email protected]>
Subject: Re: [Haskell-beginners] Adding module
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Thu, Apr 08, 2010 at 11:54:50AM +0200, [email protected] wrote:
> Hi,
>
> i need the System.IO.UTF8 module.
> But it is not in my installation package (windows xp, ghc 6.10.4); i can't
> import it, nor display html help about it.
> Where to find and how to install it ?
Hello!
Use the Hayoo! search engine:
http://holumbus.fh-wedel.de/hayoo/hayoo.html?query=System.IO.UTF8
It says in green letters that it comes from package utf8-string. Then you just
need to
cabal install utf8-string
Cheers,
--
Felipe.
------------------------------
Message: 7
Date: Thu, 8 Apr 2010 09:08:11 -0400
From: Ben Derrett <[email protected]>
Subject: [Haskell-beginners] Map on Nested Lists
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi,
I'm trying to write a generalization of the map function that operates on
nested lists, e.g. [[a]] or [[[a]]]. (It should map all elements of type a
(not list) with f)
I was thinking of something along these lines:
mapN f *list of type [a] (where a is not a list type)* = map f l
mapN f l = (mapN f (head l)):(mapN f (tail l))
Any suggestions about how to go about this?
Many thanks,
Ben
--
Ben Derrett
Department of Mathematics
MIT Class of 2012
[email protected]
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100408/e1f45eb6/attachment-0001.html
------------------------------
Message: 8
Date: Thu, 8 Apr 2010 09:16:06 -0400
From: matthew coolbeth <[email protected]>
Subject: Re: [Haskell-beginners] Map on Nested Lists
To: <[email protected]>
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
I'm a beginner too but, if I am not wrong, then you will not be able to
write a function that can receive input of type [[a]] as well as input of
type [[[a]]].
Is that the behaviour that you have in mind?
On Thu, Apr 8, 2010 at 09:08, Ben Derrett <[email protected]>wrote:
> Hi,
> I'm trying to write a generalization of the map function that operates on
> nested lists, e.g. [[a]] or [[[a]]]. (It should map all elements of type a
> (not list) with f)
>
> I was thinking of something along these lines:
> mapN f *list of type [a] (where a is not a list type)* = map f l
> mapN f l = (mapN f (head l)):(mapN f (tail l))
>
> Any suggestions about how to go about this?
>
> Many thanks,
>
> Ben
>
>
> --
> Ben Derrett
> Department of Mathematics
> MIT Class of 2012
> [email protected]
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
--
mac
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100408/f76a0a2d/attachment-0001.html
------------------------------
Message: 9
Date: Thu, 8 Apr 2010 14:37:28 +0100
From: Thomas Davie <[email protected]>
Subject: Re: [Haskell-beginners] Map on Nested Lists
To: matthew coolbeth <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
You can't write a single such function to operate on all the different types,
but you can use Conal's semantic editor combinators.
In the case of something to map onto the elements of a list of lists, you'd
want (map . map), or (fmap . fmap) to generalise things slightly.
In the case of lists of lists of lists, you need (fmap . fmap . fmap).
Note that you can generalise this to for example applying to the elements of
lists which are embedded in the first element of a tuple: first . fmap.
Or a list of Maybe tuples containing lists in their second element: fmap . fmap
. fmap . fmap
Bob
On 8 Apr 2010, at 14:16, matthew coolbeth wrote:
> I'm a beginner too but, if I am not wrong, then you will not be able to write
> a function that can receive input of type [[a]] as well as input of type
> [[[a]]].
>
> Is that the behaviour that you have in mind?
>
> On Thu, Apr 8, 2010 at 09:08, Ben Derrett <[email protected]> wrote:
> Hi,
> I'm trying to write a generalization of the map function that operates on
> nested lists, e.g. [[a]] or [[[a]]]. (It should map all elements of type a
> (not list) with f)
>
> I was thinking of something along these lines:
> mapN f *list of type [a] (where a is not a list type)* = map f l
> mapN f l = (mapN f (head l)):(mapN f (tail l))
>
> Any suggestions about how to go about this?
>
> Many thanks,
>
> Ben
>
>
> --
> Ben Derrett
> Department of Mathematics
> MIT Class of 2012
> [email protected]
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
>
>
> --
> mac
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20100408/17fd1e11/attachment.html
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 22, Issue 9
****************************************