[Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread dokondr
Hi, In GHC 7.0.3 / Mac OS X when trying to: writeFile someFile (Hoping You Have A iPhone When I Do This) Lol Sleep Is When You Close These ---gt; \55357\56384 I get: commitBuffer: invalid argument (Illegal byte sequence) The string I am trying to write can also be seen here:

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread dokondr
Correct url of a bad string: http://twitter.com/#!/search/Hoping%20You%20Have%20A%20iPhone%20When%20I%20Do%20This%20lang%3Aen On Sun, Dec 4, 2011 at 3:08 PM, dokondr doko...@gmail.com wrote: Hi, In GHC 7.0.3 / Mac OS X when trying to: writeFile someFile (Hoping You Have A iPhone When I Do

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-04 Thread Steffen Schuldenzucker
On 12/04/2011 06:53 AM, Scott Lawrence wrote: [...] Some operators might take more than one list/stream as an argument, combining them in some way or another. Obviously, if the lists were different lengths, the operator would fail. I don't want that to happen at run time, so I want to check for

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-04 Thread Scott Lawrence
On 12/04/11 02:25, Stephen Tetley wrote: Umm, an obvious point is that if you really are using lists as streams they should appear infinite to the processing code, so you shouldn't encounter operations that fail due to incompatible lengths. Didn't explain myself quite right, I guess. The

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread Donn Cave
Quoth wren ng thornton w...@freegeek.org, There was a discussion about this recently over on libraries@, IIRC. The short answer is that, at present, there is no function to give you $0. We'd like to add such a function, but it's not been done yet. Part of the problem is that, as Alexey

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-04 Thread Felipe Almeida Lessa
On Sun, Dec 4, 2011 at 3:53 AM, Scott Lawrence byt...@gmail.com wrote: type AList = [Event] type BList = [Event] type CList = [Event] myMapish :: AList - AList mySelect :: AList - (Event - Bool) - BList myOtherSelect :: BList - CList A suggestion: data Exists f = forall a. Exists f a

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Erik Hesselink
What is the value of your LANG environment variable? Does it still give the error if you set it to e.g. en_US.UTF-8? Erik On Sun, Dec 4, 2011 at 13:12, dokondr doko...@gmail.com wrote: Correct url of a bad string:

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-04 Thread Steffen Schuldenzucker
Hi Scott, a good idea. Why not use an existential to encode your types like myMap :: (a - b) - a-list of length n - b-list of length n myFilter :: (a - Bool) - a-list of length n - exists m. a-list of length m , where the first case is modeled using a type annotation and the second

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread dokondr
Is there any other way to solve this problem without changing LANG environment variable? On Sun, Dec 4, 2011 at 8:27 PM, Erik Hesselink hessel...@gmail.com wrote: What is the value of your LANG environment variable? Does it still give the error if you set it to e.g. en_US.UTF-8? Erik On

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-04 Thread Scott Lawrence
Thanks all; I haven't quite gotten it to work, but I imagine I'll be able to now (after reading up on ExistentialQuantification). -- Scott Lawrence ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Albert Y. C. Lai
On 11-12-04 07:08 AM, dokondr wrote: In GHC 7.0.3 / Mac OS X when trying to: writeFile someFile (Hoping You Have A iPhone When I Do This) Lol Sleep Is When You Close These ---gt; \55357\56384 I get: commitBuffer: invalid argument (Illegal byte sequence) The string I am trying to write can

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Erik Hesselink
Yes, you can set the text encoding on the handle you're reading this text from [1]. The default text encoding is determined by the environment, which is why I asked about LANG. If you're entering literal strings, see Albert Lai's answer. Erik [1]

[Haskell-cafe] Haskell at University in Munich

2011-12-04 Thread Bartosz Wójcik
Hello Haskell Cafe, I would be grateful for any information regarding Haskell (or at least Functional Programming) lectures at Universities near to Munich, Germany (Master or Bachelor). Unconfirmed information I've got regarding LMU and TUM are not promising. If Munich and 200 km circle do not

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread Paul R
dokondr On the contrary, standard shell variable $0 - contains a full dokondr path to the program location in the directory structure, no dokondr matter from what directory the program was called. I don't think the comparison makes sense, as shell script invocation and executable run are very

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread Richard O'Keefe
On 4/12/2011, at 7:32 PM, wren ng thornton wrote: Part of the problem is that, as Alexey says, the first element of argv is just whatever is passed to exec, which is not guaranteed to be a complete path, a canonical path, or any other specific thing we'd desire. It's not at all

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread scooter....@gmail.com
It's not a poor practice at all. Example: gcc, which uses the executable's path as the base directory from which other files are located. MacOS also does something similar. -Original message- From: Paul R paul.r...@gmail.com To: dokondr doko...@gmail.com Cc: Simon Hengel

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread scooter....@gmail.com
That's true even for regular fork/exec. -Original message- From: Richard O'Keefe o...@cs.otago.ac.nz To: wren ng thornton w...@freegeek.org Cc: haskell-cafe haskell-cafe@haskell.org Sent: Sun, Dec 4, 2011 15:54:15 PST Subject: Re: [Haskell-cafe] How to get a file path to the program