Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 18:04 schrieb Daniel Carrera: > Joel Koerwer wrote: > > Then after you've played with you creation a bit, check out > > http://haskell.org/learning.html > > Thank you. I did find that page, and it was very easy to find. There's a lin

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 17:42 schrieb Daniel Carrera: > Lemmih wrote: > > GHC is a compiler. If you want to compile to a binary then you must > > define a function called 'main'. Otherwise just load the file in ghci > > (`ghci fac.hs`). > > I would expect GHC to be able to compile a program w

Re: [Haskell-cafe] First steps in Haskell

2005-12-19 Thread Wolfgang Jeltsch
Am Sonntag, 18. Dezember 2005 17:25 schrieb Daniel Carrera: > [...] > This is a real problem for Haskell. I expect that a lot of people try > Haskell and give up because they can't even write the simplest function. Hello Daniel, honestly, I have to say that during my years with Haskell, this see

Re: [Haskell-cafe] Re: [Haskell] fptools mirror in darcs ready for testing

2005-12-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Dezember 2005 16:56 schrieb John Goerzen: > [...] > I have never worked much with these web front-ends. My understanding is > that Trac is probably not the most efficient front-end to darcs, as it > tries to put things in a more svn-like model. I wonder if one of the > other fr

Re: [Haskell-cafe] Can't Haskell catch up with Clean's uniqueness typing?

2005-12-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Dezember 2005 18:38 schrieb [EMAIL PROTECTED]: > [...] > p.p.s.: I've sent this mail a second time because the first one got lost > somehow - hopefully, it doesn't show up again. Concerning me, your first mail wasn't lost. I got this mail two times. Best wishes, Wolfgang

Re: [Haskell-cafe] Can't Haskell catch up with Clean's uniqueness typing?

2005-12-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Dezember 2005 13:08 schrieb [EMAIL PROTECTED]: > [...] > A uniqueness checker can be rather robust, as is demonstrated by the Clean > one, so all we'd have to worry about is how to find a good set of supposedly > unique node candidates to suggest to the checker. (It certainly wo

Re: [Haskell-cafe] Can't Haskell catch up with Clean's uniqueness typing?

2005-12-08 Thread Wolfgang Jeltsch
Am Donnerstag, 8. Dezember 2005 04:00 schrieb Jan-Willem Maessen: > On Dec 7, 2005, at 9:58 AM, Wolfgang Jeltsch wrote: > > Am Mittwoch, 7. Dezember 2005 14:21 schrieb Jan-Willem Maessen: > >> [...] > >> > >> The principle obstacles are the same as for any

Re: [Haskell-cafe] Learning Haskell

2005-12-07 Thread Wolfgang Jeltsch
Am Mittwoch, 7. Dezember 2005 20:53 schrieb Sebastian Sylvan: > [...] > It may make it harder for people to grasp the difference between an > IORef and a regular value though... And this might be a big problem. It reminds me of languages which do a lot of automatic type conversion, including au

Re: [Haskell-cafe] Learning Haskell

2005-12-07 Thread Wolfgang Jeltsch
Am Dienstag, 6. Dezember 2005 20:58 schrieb Bulat Ziganshin: > [...] > i already sayed about lacking of OOP features. This is the old discussion again. Do we need OOP features? Or do we want to avoid OOP features? I would like to avoid them. Maybe I have not enough experience with situation

Re: [Haskell-cafe] Can't Haskell catch up with Clean's uniqueness typing?

2005-12-07 Thread Wolfgang Jeltsch
Am Mittwoch, 7. Dezember 2005 14:21 schrieb Jan-Willem Maessen: > [...] > The principle obstacles are the same as for any reference counting scheme: > It imposes more run-time overhead than GC does, unless the data structures > involved are large. Why? I think the point with uniqueness typing/an

Re: [Haskell-cafe] Learning Haskell

2005-12-06 Thread Wolfgang Jeltsch
Am Dienstag, 6. Dezember 2005 14:43 schrieb Bulat Ziganshin: > [...] > so, in my feel, Haskell is better in areas where there is no standard > quick-and-dirty solutions and all languages are in equal conditions, > but it can't compete with Visual Basic in user interfaces, Erlang in > distributed p

Re: [Haskell-cafe] Lazier I/O?

2005-11-28 Thread Wolfgang Jeltsch
Am Montag, 28. November 2005 13:27 schrieb Dimitry Golubovsky: > [...] > What is desired is to have the IO actions perform as their results are > needed. I am assuming some knowledge that those actions have only > limited scope of side effects (e. g. order of outputs within a window is > significa

Re: [Haskell-cafe] Haskell GUI on top of Xlib?

2005-11-26 Thread Wolfgang Jeltsch
Am Samstag, 26. November 2005 12:08 schrieb Duncan Coutts: > [...] > http://xcb.freedesktop.org/wiki/XCBToDo > (see bottom of that page: "XCB for other languages") "A problem occurred in a Python script." :-( > Duncan Best wishes, Wolfgang ___ Haskel

Re: [Haskell-cafe] Re: Monads in Java, Joy, OCaml, Perl, Prolog, Python, Ruby, and Scheme was Re: Other languages using monads?

2005-11-26 Thread Wolfgang Jeltsch
Am Samstag, 26. November 2005 03:56 schrieb Geoffrey Alan Washburn: > [lots of code] It's interesting to note how verbose Java is in comparison to Haskell, at least, concerning this monad stuff. Best wishes, Wolfgang ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 21:52 schrieb Fan Wu: > > They cannot belong to the same monad. If s is the state type and m1' and > > m2' belong to the monad m then m1 and m2 belong to the monad StateT s m. > > I know it looks insane, I'm just trying to make a recursive case of > it: technically

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 21:37 schrieb Fan Wu: > [...] > This is a good example! But now I got the impression that pattern > match failure could happen in many places, so unless you want it to > fail loudly, you shall always use lazy pattern? Often you need pattern matching for distinguis

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 21:19 schrieben Sie: > [...] > Here I want to correct a statement I made previously about: > > mplus m1 m2 = do ... > ~(a,s') <- lift (mplus m1' m2') > > In one of my emails to the thread I mentioned m1/m2 and m1'/m2' could > be dif

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 02:08 schrieb David Menendez: > Wolfgang Jeltsch writes: > > If we use an implementation of State *without lazy patterns*, it > > becomes something like this: > > > > \s -> case next s of > > (x,s') -> case

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 01:49 schrieb Fan Wu: > Hi Wolfgang, > > Thanks for your response and examples! It helps a lot. > > From your example I can see "Lazy patterns are useful in contexts > where infinite data structures are being defined recursively" (quote > section 4.4 of Gentle Intro

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Donnerstag, 24. November 2005 19:24 schrieb Fan Wu: > Hi Wolfgang, > > I don't know the history so maybe this is a new implementation of > State transformer. The Peek and poke functions are defined below > (copied from StateT.hs): > > instance Monad m => StateM (StateT s m) s where > peek

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Mittwoch, 23. November 2005 20:42 schrieb Wolfgang Jeltsch: > Am Mittwoch, 23. November 2005 19:02 schrieb Fan Wu: > [...] > > But it is still not clear to me why lazy pattern is used here. Any ideas? > > Let's discuss this for State instead of StateT because this makes

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-24 Thread Wolfgang Jeltsch
Am Mittwoch, 23. November 2005 10:03 schrieb Fan Wu: > Hi Haskell gurus, > > I'm very puzzled on some code I saw in GHC Monad.StateT (which is > about state monad transformers) source and hope you can kindly give me > some insight into this. > > newtype StateT s m a = S (s -> m (a,s)) > > instance

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-23 Thread Wolfgang Jeltsch
Am Mittwoch, 23. November 2005 19:02 schrieb Fan Wu: > HI Wolfgang, > > The code is from GHC source > ghc-6.4.1/libraries/monads/Monad/StateT.hs, am I looking at the wrong > place? > > I found the thread discussing "Monad strictness", where is your StateT > defined? Hello Fan, the GHC source is j

Re: [Haskell-cafe] questions on lazy pattern, StateT monad

2005-11-23 Thread Wolfgang Jeltsch
Am Mittwoch, 23. November 2005 10:03 schrieb Fan Wu: > [...] > I'm puzzled over this line: > > ~(a,s') <- lift (mplus m1' m2') Why is this line in Monad.State.StateT? Recently, we discussed that StateT does *not* use a lazy pattern here but that it should be changed to using one. So where

Re: [Haskell-cafe] Existential quantification of environments.

2005-11-22 Thread Wolfgang Jeltsch
Am Dienstag, 22. November 2005 17:19 schrieben Sie: > Wolfgang Jeltsch wrote: > >>This seems to suggest: > >> > >>Add a == exists (add :: a -> a -> a) > > > >Doesn't "exists" normally quantify over types and not over values? > &

Re: [Haskell-cafe] Existential quantification of environments.

2005-11-22 Thread Wolfgang Jeltsch
Am Dienstag, 22. November 2005 11:39 schrieb Keean Schupke: > [...] > This seems to suggest: > > Add a == exists (add :: a -> a -> a) Doesn't "exists" normally quantify over types and not over values? > [...] Best wishes, Wolfgang ___ Haskell-Cafe

Re: [Haskell-cafe] records proposals list

2005-11-22 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 20:34 schrieb Max Eronin: > On 11/21/05, David Roundy <[EMAIL PROTECTED]> wrote: > > class Coord a where > > get_x :: a -> Double > > get_y :: a -> Double > > set_x :: Double -> a -> a > > set_y :: Double -> a -> a > > I'd say this is a typical OO solution to th

Re: [Haskell-cafe] records proposals list

2005-11-22 Thread Wolfgang Jeltsch
Am Dienstag, 22. November 2005 07:33 schrieb David Menendez: > Keean Schupke writes: > > Haskell already has static records (in H98) > > > > Dynamic records are addressed by the HList library, which uses > > extensions already present in GHC and Hugs (namely Multi-parameter > > type-classes

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-22 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 20:51 schrieb Henning Thielemann: > On Mon, 21 Nov 2005, Wolfgang Jeltsch wrote: > [...] > > Hmm, printing code on paper isn't good for the environment. > > But is quite the same argument for e-paper. :-) I already thought about this. But if

Re: [Haskell-cafe] Monad strictness

2005-11-21 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 16:09 schrieb Roberto Zunino: > Yitzchak Gale wrote: > > In the following, why does testA work and testB diverge? > > Where is the strictness coming from? > > My guess: from strict pattern matching in (>>=). This is a problem I came across some months ago. State uses

Re: [Haskell-cafe] records proposals list

2005-11-21 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 14:27 schrieb David Roundy: > On Sun, Nov 20, 2005 at 04:21:05PM +0100, Wolfgang Jeltsch wrote: > > Am Samstag, 19. November 2005 17:35 schrieb Bulat Ziganshin: > > > 7. OOP-like fields inheritance: > > > > > > data Coord = { x,y

Re: [Haskell-cafe] records proposals list

2005-11-21 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 13:37 schrieb Bulat Ziganshin: > [...] > > You should never use bad design to increase usability, I'd say. > > to be exact now i have the following definitions: > [...] > i prefer to replace second definition with the > > [...] > data CompressedFile : FileInfo =

Re: [Haskell-cafe] Records (was Re: [Haskell] Improvements to GHC)

2005-11-21 Thread Wolfgang Jeltsch
Am Sonntag, 20. November 2005 12:28 schrieb Jesper Louis Andersen: > [...] > The best argument I can come up with when advocating lines of 80 chars > for most programming code is subtle, but important: > > Code is easier to read for me when it is printed on good old paper. > a2ps(1) is magnificien

Re: [Haskell-cafe] records proposals list

2005-11-21 Thread Wolfgang Jeltsch
Am Montag, 21. November 2005 08:31 schrieb Bulat Ziganshin: > Hello Wolfgang, > > Sunday, November 20, 2005, 6:21:05 PM, you wrote: > >> data Coord = { x,y :: Double } > >> data Point : Coord = { c :: Color } > > > A point is not a special coordinate pair. Instead it has a coordinate > > paar as o

Re: [Haskell-cafe] records proposals list

2005-11-20 Thread Wolfgang Jeltsch
Am Samstag, 19. November 2005 17:35 schrieb Bulat Ziganshin: > [...] > 7. OOP-like fields inheritance: > > data Coord = { x,y :: Double } > data Point : Coord = { c :: Color } > > of course this is just another sort of syntax sugar once we start > using classes to define getter/setter functions I

Re: [Haskell-cafe] records proposals list

2005-11-19 Thread Wolfgang Jeltsch
Am Samstag, 19. November 2005 14:57 schrieb David Roundy: > [...] > 2. Multi-constructor getters, ideally as a function: > > An accessor ought to be able to access an identically-named field from > > multiple constructors of a given data type: > > data FooBar = Foo { name :: String } | Bar { name

Re: [Haskell-cafe] How to use a wiki to annotate GHC Docs? was Re: [Haskell] Re: Making Haskell more open

2005-11-18 Thread Wolfgang Jeltsch
Am Mittwoch, 16. November 2005 20:02 schrieb Cale Gibbard: > [...] > It's unfortunate, but if you don't put a little bit of effort into > defending your forms, they will eventually get quite a lot of spam. > Cleaning up 600+ pages by hand takes quite a lot of effort, even with > the ability to rev

Re: [Haskell-cafe] How to use a wiki to annotate GHC Docs? was Re: [Haskell] Re: Making Haskell more open

2005-11-16 Thread Wolfgang Jeltsch
Am Mittwoch, 16. November 2005 12:33 schrieb Scott Weeks: > The public comment/wiki spam problem is easily solved. > > Use JavaScript to generate a value and put it in a hidden form field. > Check for that value server side, if it's there then allow the post > otherwise disallow. > > Most if not al

Re: [Haskell-cafe] doc/html -> wiki -> xml

2005-11-16 Thread Wolfgang Jeltsch
Am Mittwoch, 16. November 2005 10:10 schrieben Sie: > [...] > The ideal is to have a simple, rigid, semantic markup in the source > document. While I dislike XML at least as much as the next guy, it is > probably the best choice for this. Ideally, the DTD should be a lot > simpler than DocBook

Re: [Haskell-cafe] doc/html -> wiki -> xml

2005-11-15 Thread Wolfgang Jeltsch
Am Dienstag, 15. November 2005 12:44 schrieb Scott Weeks: > Frankly, the best way to go about writing your doc would be to do it in > LaTeX/literate haskell. That way you could compile it to > html/pdf/whatever. Oh no! Converting LaTeX to HTML is terrible, in my opinion. One reason for this is

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Wolfgang Jeltsch
Am Sonntag, 13. November 2005 22:22 schrieb Gour: > [...] > But don't forget, as it was already stated, get the whole working-chain > ready for authoring in Docbook is not at all ready and for one not > proficient in emacs with SGML mode it is very difficult to write texts with > so many tags. Yo

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Wolfgang Jeltsch
Am Montag, 14. November 2005 10:49 schrieb Ketil Malde: > [...] > I think it would be ideal to provide the documentation on the web as > now, but linking to wikified talk pages. Something like Wikipedia, > (since MediaWiki was brought up) but perhaps with restricted write > access to the "feature

Re: [Haskell-cafe] Re: [Haskell] Making Haskell more open

2005-11-14 Thread Wolfgang Jeltsch
Am Sonntag, 13. November 2005 22:05 schrieb Gour: > [...] > > The question is if HTML is sufficient. In addition, HTML is at some > > points not well thought-out. > > True, but considering the present situation, it is all what is required. I doubt this. How, for example, do you implement code s

Re: [Haskell-cafe] Template Haskell -- Bug?

2005-10-20 Thread Wolfgang Jeltsch
Am Donnerstag, 20. Oktober 2005 15:02 schrieb Gracjan Polak: > Hi, > > Could somebody try to compile these two files *TWICE*? Hello Gracjan, I did so, using GHC 6.4.1 on Debian GNU/Linux, installed from the binary archive for generic Linux. Upon the first run, I got the same messages, you got.

Re: [Haskell-cafe] newtype is superfluous

2005-10-15 Thread Wolfgang Jeltsch
Am Samstag, 15. Oktober 2005 08:31 schrieb Bulat Ziganshin: > Hello Haskell, > > number of type definition statements in Haskell (data, type, newtype) is > a bit too large. at least, newtype definition seems to be superfluous - it > can be replaced by the same `data` definition: > > newtype A = A

[Haskell-cafe] Re: Interest in helping w/ Haskell standard

2005-10-15 Thread Wolfgang Jeltsch
Am Freitag, 14. Oktober 2005 16:25 schrieben Sie: > On Fri, Oct 14, 2005 at 04:20:24PM +0200, Wolfgang Jeltsch > <[EMAIL PROTECTED]> wrote: > > > I always couldn't understand why one has to write regular > > expressions as strings > > Because the language

[Haskell-cafe] Re: Interest in helping w/ Haskell standard

2005-10-15 Thread Wolfgang Jeltsch
Am Freitag, 14. Oktober 2005 16:26 schrieben Sie: > On Fri, Oct 14, 2005 at 04:20:24PM +0200, > Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote > > a message of 23 lines which said: > > alpha = ('A' `to` 'Z') ||| ('a' `to` 'z') &

Re: [Haskell-cafe] Re: Interest in helping w/ Haskell standard

2005-10-14 Thread Wolfgang Jeltsch
Am Donnerstag, 13. Oktober 2005 13:39 schrieb Stephane Bortzmeyer: > [...] > Regexps and XML are, IMHO, also "must haves". By the way, it should be possible to handle regular expressions in an Haskell-like way. I always couldn't understand why one has to write regular expressions as strings wh

Re: [Haskell-cafe] New to Monads

2005-10-07 Thread Wolfgang Jeltsch
Am Freitag, 7. Oktober 2005 06:32 schrieb Cale Gibbard: > That | m -> s reads "where m determines s", and means that there can > be at most one s (here, the state type) for a given m (the monad > type). This is used in type inference and checking to ensure that the > type of state being carried aro

Re: [Haskell-cafe] Short Cut / Rewrite Rules Problem in GHC

2005-10-04 Thread Wolfgang Jeltsch
Am Dienstag, 4. Oktober 2005 04:15 schrieb Chris: > [...] > When I don't have them enabled it gives this error: > > chris$ ghc --make Main.hs > Chasing modules from: Main.hs > Compiling Main ( Main.hs, Main.o ) > > Main.hs:8:18: parse error on input `.' I suppose, this is beca

Re: [Haskell-cafe] Converting [Word8] to String

2005-10-04 Thread Wolfgang Jeltsch
Am Sonntag, 2. Oktober 2005 12:52 schrieb Joel Reymont: > Folks, > > How do I convert a list of bytes to a string? > > Cale has suggested a neat way of parsing binary packets in this thread: > > http://www.mail-archive.com/haskell-cafe@haskell.org/msg09413.html > > and I'm trying to create a packet

Re: [Haskell-cafe] newbe question

2005-09-28 Thread Wolfgang Jeltsch
Am Dienstag, 27. September 2005 21:54 schrieb [EMAIL PROTECTED]: > On 27 Sep, Glynn Clements wrote: > > It isn't defined in the prelude or any of the standard libraries. > > > > The point is that the Haskell tokeniser treats any consecutive > > sequence of the symbols !#$%&*+./<=>[EMAIL PROTECTED]|

Re: [Haskell-cafe] newbe question

2005-09-27 Thread Wolfgang Jeltsch
Am Dienstag, 27. September 2005 11:34 schrieb [EMAIL PROTECTED]: > Hi > i can not load program test1 into hugs, but test2 works. > Am i missing some special syntax? > > greetings, > Philip > > -- test1 -- > > foo :: Maybe Int -> Int > foo Nothing =-1 > foo (Just a)= a >

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-19 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 18:40 schrieben Sie: > Wolfgang Jeltsch wrote: > > > > > Bearing this in mind, and hoping you can see where I'm coming from, > > > > > I think my question is: shouldn't you guys be using Lisp? > > > > &g

Re: [Haskell-cafe] Haskell versus Lisp

2005-09-19 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 17:42 schrieb Mark Carter: > Wolfgang Jeltsch wrote: > >Am Freitag, 16. September 2005 15:06 schrieb Mark Carter: > >>Plus you can use macros to extend the language. > > > >I don't know really about LISP macros but aren't the

Re: [Haskell] Re: [Haskell-cafe] Haskell versus Lisp

2005-09-19 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 16:46 schrieben Sie: > . . . > > > In Haskell, code is data too because code in the sense of imperative > > actions is described by IO values. You cannot analyse them. But you can > > use your do expressions etc. to construct action descriptions with a more > > ge

Re: [Haskell-cafe] And another basic typing question -- empty list

2005-09-16 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 16:02 schrieb Adam Wyner: > [...] > Suppose I have two expressions: > > emptyListA = null > > emptyListB = [] > > emptyListA is apparently a function from empty lists to Bool. emptyListA is a function from *arbitrary* lists to Bool. > [...] > The problem is that t

Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 15:29 schrieb Glynn Clements: > David Roundy wrote: > > > Bearing this in mind, and hoping you can see where I'm coming from, I > > > think my question is: shouldn't you guys be using Lisp? > > > > Lisp is impure, weakly typed and has way too many parentheses. Why wo

Re: [Haskell-cafe] Haskell versus Lisp

2005-09-16 Thread Wolfgang Jeltsch
Am Freitag, 16. September 2005 15:06 schrieb Mark Carter: > Plus you can use macros to extend the language. I don't know really about LISP macros but aren't they a bit like Template Haskell? Since Haskell (even without Template Haskell) is a small but flexible language you can construct domain-

Re: [Haskell-cafe] Functional vs Imperative

2005-09-13 Thread Wolfgang Jeltsch
Am Dienstag, 13. September 2005 15:45 schrieb Dhaemon: > [...] > Also, just for kicks, may I had this: I read the code of some haskell-made > programs and was astonished. Yes! It was clean and all, but there were > "do"s everywhere... Why use a function language if you use it as an > imperative on

[Haskell-cafe] Re: [Haskell] unsafePerformIO and optimizations

2005-08-09 Thread Wolfgang Jeltsch
Am Montag, 8. August 2005 11:33 schrieb Simon Marlow: > [...] > This way leads to madness - GHC's optimisations are simply not designed > to provide any kind of guarantee about maintaining sharing properties. > The guidelines we've given for unsafePerformIO are enough to cover > simple uses like g

Re: [Haskell-cafe] Hierarchical Library

2004-04-24 Thread Wolfgang Jeltsch
Am Samstag, 24. April 2004 10:40 schrieb Wolfgang Jeltsch: > [...] > Use > import System.Posix.Temp > test = mkstemp > instead. By the way, you can also use import System.Posix.Temp test = System.Posix.Temp.mkstemp or import System.Posix.Temp as T

Re: [Haskell-cafe] Hierarchical Library

2004-04-24 Thread Wolfgang Jeltsch
Am Samstag, 24. April 2004 09:23 schrieb [EMAIL PROTECTED]: > Hello, > > Why does this fail? > > == > import System.Posix > > test = Temp.mkstemp > == > > Are the libraries hierarchical in name only? > > Thanks, > > James Use import System.Posix.

Re: [Haskell-cafe] FiniteMap, Map, FiniteSet, Set

2004-04-24 Thread Wolfgang Jeltsch
Am Samstag, 24. April 2004 03:50 schrieb John Meacham: > On Fri, Apr 23, 2004 at 08:02:47PM -0500, [EMAIL PROTECTED] > wrote: > > Why does the library have [FiniteMap and Set] instead of [FiniteMap and > > FiniteSet] or just [Map and Set]? Is there some reason for this > > inconsistency? > > Histo

Re: [Haskell-cafe] WildCard question

2004-04-13 Thread Wolfgang Jeltsch
Am Dienstag, 13. April 2004 16:07 schrieb Paul Cosby: > Hi, > > I am very new to haskell and the program hugs and I am having problems > using the wildcard operator _ > > Every time I try to use it in an definition it says something like the > symbol /017 is not recognised. Are you sure that it sa

Re: [Haskell-cafe] A useful trick for inclusion and exclusion of commented code

2004-04-12 Thread Wolfgang Jeltsch
Am Sonntag, 11. April 2004 23:14 schrieb Sunil KOTHARI: > Here's a little trick that I often use for inclusion and exclusion of > a chunk of code. > Imagine we have a function foo defined below. > The three lines of code can be included > or excluded just by a changing a single character --- th

Re: [Haskell-cafe] Newbie: Is it possible to catch _|_ ?

2004-04-06 Thread Wolfgang Jeltsch
Am Dienstag, 6. April 2004 16:23 schrieb Russ Lewis: > Another newbie question: Is it possible to catch _|_ - that is, to > encounter it, handle it and continue? I'm assuming that you all are > going to say no, since I can't figure out any way to do this and retain > the functional nature of Haske

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-31 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 15:42 schrieb MR K P SCHUPKE: > > data Either a =3D > > Num a =3D> Left a > > Ord a =3D> Right a > > This is a mistake because the same variable is being constrained in > two different ways. The only way both constrains can be satisfied > is if

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-31 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 14:36 schrieb MR K P SCHUPKE: > >This syntax would also have the advantage that you can apply different > >contexts to different constructors. > > Er, you can already do that as I just pointed out: > > data (Ord a,Num b) => Either a b = Left a | Right b > > Note that to c

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-31 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 13:51 schrieb Henning Thielemann: > [...] > > A data type declaration creates two things - the data type itself > > and the constructor function. > > > > If you consider the constrains in the data type declaration to > > apply only to the constructor then it all makes se

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-31 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 10:28 schrieb Henning Thielemann: > On Wed, 31 Mar 2004, Simon Peyton-Jones wrote: > > I'm sorry to say that you just can't make Set an instance of Monad. > > > > To make an instance of Monad for a type constructor T you must have a > > function > > > > bindT :: foral

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-30 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 09:32 schrieben Sie: > On Wed, Mar 31, 2004 at 08:48:35AM +0200, Wolfgang Jeltsch wrote: > > > Now, as i think a little more about it, i believe what you want to do > > > makes no sense. The monad operation '>>=' works on monads

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-30 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 03:11 schrieb Benjamin Franksen: > >instance Monad Set where > > m >>= k = concatSets (mapSet k m) > > return x = unitSet x > > fail s = emptySet > > > >concatSets sets = foldl union emptySet (setToList sets) > >instance (Eq b,Ord b) => Ord (

Re: [Haskell-cafe] Adding Ord constraint to instance Monad Set?

2004-03-30 Thread Wolfgang Jeltsch
Am Mittwoch, 31. März 2004 00:11 schrieb S. Alexander Jacobson: > [...] > Could not deduce (Ord b) from the context (Monad Set) > arising from use of `concatSets' at dbMeta3.hs:242 > Probable fix: > Add (Ord b) to the class or instance method `>>=' > In the definition of

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Wolfgang Jeltsch
Am Mittwoch, 3. MÃrz 2004 18:15 schrieb Georg Martius: > Thanks for your answer. I got it now. > It works with lift instead of liftM. Yes, of course. > Georg Wolfgang ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listi

Re: [Haskell-cafe] State Monad

2004-03-03 Thread Wolfgang Jeltsch
Am Mittwoch, 3. MÃrz 2004 14:44 schrieb Georg Martius: > [...] > Now I have also functions to map from (a, String) -> (a,String). I could > write: > > modifyT :: ((a, String) -> (a, String)) -> a -> State String a > modifyT trans a = do str <- get > let (a', str') = trans (a

Re: There is flexible exception handling in Haskell?

2003-11-18 Thread Wolfgang Jeltsch
Am Dienstag, 18. November 2003, 02:40 schrieb Bernard James POPE: > Sometimes you can just encode your exceptional values in some type. It tends > to be more declarative than throwing/catching exceptions: > >data Result = Ok Int | ThisError | ThatError String | SomeError Int ... I think, it's

Re: determining if a int is a power

2003-11-08 Thread Wolfgang Jeltsch
Am Samstag, 8. November 2003, 13:13 schrieb Paul Hudak: > But note that x `seq` x is equivalent to x, even operationally. To see why > denotationally, note that if x evaluates to _|_, so does x `seq` x. And if > x evaluates to a value v, so does x `seq` x. To see why operationally, > consider th

Re: determining if a int is a power

2003-11-08 Thread Wolfgang Jeltsch
Am Samstag, 8. November 2003, 00:22 schrieb Hamilton Richards: > Also note that > > if x then True else False > > is just a verbose way of writing > > x Actually, it's just a verbose way of writing x `seq` x, but this detail is, of course, not interesting for beginners. Wolfgang ___

Re: Haskellsupport in KDevelop

2003-10-04 Thread Wolfgang Jeltsch
Am Samstag, 4. Oktober 2003, 19:15 schrieb Peter Robinson: > Hello, > > I've begun to write a plugin that provides basic support for Haskell in > KDevelop 3.0 alpha. (http://www.kdevelop.org). Great! I will probably use it since I like Haskell and KDE very much. By the way, wasn't KDevelop only f

Re: "interact" behaves oddly if used interactively

2003-10-02 Thread Wolfgang Jeltsch
Am Donnerstag, 2. Oktober 2003, 10:52 schrieb Nicholas Nethercote: > On Wed, 1 Oct 2003, Robert Ennals wrote: > > Haskell is a good language, pureness is good, type classes are good, > > monads are good - but laziness is holding it back. > > Hear hear. > > I have often wondered how much simpler the

Re: Haskell-beginners problem with memory consuption

2003-10-01 Thread Wolfgang Jeltsch
Am Mittwoch, 1. Oktober 2003, 15:18 schrieb Petter Egesund: > [...] > The problem is of course that the string is copied each time I do a > substitute, and I wonder if a more experienced haskeller has a better > solution to my problem. It doesn't have to be a problem that the string is copied eac

Re: Problem with Infinite Lists

2003-09-03 Thread Wolfgang Jeltsch
Am Mittwoch, 3. September 2003 12:50 schrieb Steffen Mazanek: > Hello, > > >all_fib :: [Float] > > You define "all_fib" to return a list of "Float", but "even" does only work > for numbers whose type is an instance of the class Integral, e.g. Int. > > HTH and ciao, > Steffen And I see no reason to

Re: Yet Another Monad Tutorial

2003-08-26 Thread Wolfgang Jeltsch
On Thursday, 2003-08-14, 13:37, CEST, blaat blaat wrote: > [...] Hello, I don't know exactly which of the following questions have already been answered but I decided to answer them all anyway. > What is the difference between putStr "a", (putStr "a", putStr "a"), putStr > (putStr "a"), putStr

Re: recursion

2003-08-23 Thread Wolfgang Jeltsch
On Thursday, 2003-08-21, 13:32, CEST, Keith Wansbrough wrote: > [...] > BTW: please post in plain ASCII, not HTML - this should be an option in > Hotmail somewhere. It makes it easier for people to read your messages and > reply to them. Or post both, plain text and HTML, in combination. Users o

Re: Monads and Maybe

2003-08-19 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-19, 12:42, CEST, Konrad Hinsen wrote: > I have been following the recent "Monad tutorial" discussion with interest, > and even read the tutorial, which is a useful addition to the existing > Haskell documentation. So useful in fact that it raises a question... > > The whole mona

Re: Yet Another Monad Tutorial

2003-08-14 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-12, 12:14, CEST, Alistair Bayley wrote: > [...] > > Care to explain why you think Haskell is not pure? > > Purely functional = you are always defining and calling pure functions. > Calling a pure function with the same arguments always gives the same > results. In Haskell, if

Re: IO Bool -> Bool

2003-08-14 Thread Wolfgang Jeltsch
On Thursday, 2003-08-14, 07:20, CEST, Tn X-10n wrote: > hai guys > is it possible to convert IO Bool to Bool? No. The reason for introducing the IO type is to preserve the purity of Haskell, i.e., to ensure that expression evaluation doesn't depend on the state of the outside world and doesn't

Re: IO Bool -> Bool

2003-08-14 Thread Wolfgang Jeltsch
On Thursday, 2003-08-14, 17:05, CEST, Kevin S. Millikin wrote: > On Wednesday, August 13, 2003 11:20 PM, Tn X-10n > [SMTP:[EMAIL PROTECTED] wrote: > > is it possible to convert IO Bool to Bool? > > Sure. Which Bool do you want? True? > > > toTrue :: IO Bool -> Bool > > toTrue x = True > > Or Fal

Re: Yet Another Monad Tutorial

2003-08-14 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-12, 18:20, CEST, Jeff Newbern wrote: > [...] > In the section "No Way Out": > -- > The IO monad is a familiar example of a one-way monad in Haskell. Because > you can't escape from the IO monad, it is impossible to write a function > that does a computation in the IO mo

Re: Another typing question

2003-08-14 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-05, 15:22, CEST, Nick Name wrote: > [...] > > Is there any way to parametrize a type by a value, rather than another > > type? What I would like to do is to define "list of length 3" and "list of > > length 4" as separate parametrization of the same type, such that I could > >

Re: [newbie] UTF-8

2003-08-14 Thread Wolfgang Jeltsch
On Sunday, 2003-08-10, 19:27, CEST, Danon'. wrote: > Hi, > > We try to make a program which write on stdout the UTF-8 character > corresponding to an input unicode value. UTF-8 encodes each unicode value as a stream of octets. So there are two mistakes in your sentence above: 1. You want to o

Re: Yet Another Monad Tutorial

2003-08-14 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-12, 13:10, Alistair Bayley wrote: > > From: Wolfgang Jeltsch [mailto:[EMAIL PROTECTED] > > > > For example, the function readFile is pure. For a specific string s the > > expression readFile s always yields the same result: an I/O action which > &g

Re: Another typing question

2003-08-08 Thread Wolfgang Jeltsch
On Tuesday, 2003-08-05, 12:23, CEST, Konrad Hinsen wrote: > Is there any way to parametrize a type by a value, rather than another > type? No, there isn't. > What I would like to do is to define "list of length 3" and "list of length > 4" as separate parametrization of the same type, such that I

Re: Type design question

2003-07-26 Thread Wolfgang Jeltsch
On Friday, 2003-07-25, 21:48, Dylan Thurston wrote: > [...] > Another approach is to make Universe a multi-parameter type class: > > class (RealFrac a, Floating a) => Universe u a | u -> a where > distanceVector :: u -> Vector a -> Vector a -> Vector a > ... > > You need to use ghc with '-fglasg

Re: lazy Printing question

2003-07-22 Thread Wolfgang Jeltsch
On Monday, 2003-07-21, 14:36, CEST, David Roundy wrote: > [...] > My guess would be to try running > > main = putStr $ unlines $ map show $ filter magicP sqs > > It may be that print is doing something like checking the length of the list > which would of course not allow for lazy printing. Is pr

Re: Arrow Classes

2003-07-10 Thread Wolfgang Jeltsch
On Thursday, 2003-07-10, 15:33, Ross Paterson wrote: > [...] > Subclasses in Haskell cover a range of relationships, including this sense > where things in the subclass automatically belong to the superclass. Other > examples include Eq => Ord and Functor vs Monad. By the way, I strongly vote for

Re: Arrow Classes

2003-07-10 Thread Wolfgang Jeltsch
On Thursday, 2003-07-10, 15:33, Ross Paterson wrote: > [...] > There are more instances and methods for people to define, even if some of > them imply others. > > As it happens, I would like yet another intermediate class: > > class BiFunctor a where > bimap :: (b' -> b) -> (c

Re: Hugs Humor

2003-07-07 Thread Wolfgang Jeltsch
On Monday, 2003-07-07, 13:05, CEST, Ross Paterson wrote: > [...] > In the case of 0.1::Rational, it shouldn't be using floating point. The > Report says this means fromRational (1%10), i.e. 1%10. In which paragraph of the report is this specified? > [...] Wolfgang _

Re: Hugs Humor

2003-07-07 Thread Wolfgang Jeltsch
On Monday, 2003-07-07, 01:37, CEST, Andrew J Bromage wrote: > [...] > On Sat, Jul 05, 2003 at 07:43:18PM +0200, Steffen Mazanek wrote: > > Prelude> 0.1::Rational > > 13421773 % 134217728 > > That's allowed. The Rational only has to be correct to the limit of machine > precision. (Incidentally, i

<    1   2   3   4   5   >