RE: internal error: eval_thunk_selector: strange selectee 29

2003-08-14 Thread Simon Marlow
(Apologies for the repeated message, the moderator seems to be out at the moment, so I just subscribed to the list and resent it, this time with a bit more information) Trying to run profiling (+RTS -p -RTS), I get: xsactp: internal error: eval_thunk_selector: strange selectee 29

Re: ghc 6.0.1 and Mac OS X 10.2.6 build

2003-08-14 Thread Gregory Wright
Hi Wolfgang, Thanks again for the prompt reply. I did exactly as you noted below (removed the framework support check from configure.in, ran autoconf and ./configure, then built. Everything works appears to work correctly but ghci. (For example, I can build a network test program that queries

Re: ghc 6.0.1 and Mac OS X 10.2.6 build

2003-08-14 Thread Wolfgang Thaller
I should note that I've done the build without Wolfgang's HaskellSupportFramework, by setting the include and library paths in build.mk. This is more compatible with the automated packing scheme of DarwinPorts. Of course. The HaskellSupport.framework isn't necessary when the user already has

RE: internal error: eval_thunk_selector: strange selectee 29

2003-08-14 Thread Simon Marlow
--make is just too pleasant not to be used. I can always clean out things in case of weird errors. Would you like me to submit subsequent reports if I encounter further problems? If you get into a state where --make produces a crashing program, then it's a good idea to take a snapshot of

RE: internal error: eval_thunk_selector: strange selectee 29

2003-08-14 Thread Simon Marlow
Simon Marlow [EMAIL PROTECTED] writes: Can you send the code, or is it too large? Both of the above. :-) There is something really fishy going on; I checked out the same code in a different directory, and built it in the same way, without getting the same behaviour. Hmm. Profiling

Re: internal error: eval_thunk_selector: strange selectee 29

2003-08-14 Thread Ketil Z. Malde
Simon Marlow [EMAIL PROTECTED] writes: There is something really fishy going on; I checked out the same code in a different directory, and built it in the same way, without getting the same behaviour. Hmm. Profiling isn't deterministic though, because heap samples happen based on a timer

RE: very strange behavior (crashes!) with Dynamics

2003-08-14 Thread Hal Daume
This hasn't yet been posted, but I've actually whittled it down quite a bit. All we need is to import the Util.DynamicMap and do: dm1 = addToDM emptyDM (Range 1 2) showDM :: DShow - DynamicMap - ShowS showDM sd = foldDM (\d b - case sd d of { Nothing - b ; Just s - s . b }) id and do the

RE: very strange behavior (crashes!) with Dynamics

2003-08-14 Thread Hal Daume
Okay, this is the last spam from me. Here's exactly what you need to do to get the bug. Create three modules, DynamicMap.hs, Range.hs and Coref.hs, containing the following: DynamicMap.hs module DynamicMap ( DynamicMap, emptyDM, addToDM, foldDM

RE: very strange behavior (crashes!) with Dynamics

2003-08-14 Thread Hal Daume
Okay, I know I promised that was the last one, but you can actually get it simpler. Remove all the dynamic map stuff. Just have two files, Range.hs and Coref.hs, with: module Range where import Data.Dynamic data Range = Single Int | Range Int Int deriving (Eq, Ord,

AWARD NOTIFICATION.

2003-08-14 Thread primitivalote
LOTTERY LA PRIMITIVA. C/GUZMAN EL BUENO,137 MADRID - ESPAÑA. TEL: +34-645-633-391 AND FAX +34-660-697-521 FROM: THE DESK OF THE PROMOTIONS MANAGER, INTERNATIONAL PROMOTIONS/PRIZE AWARD DEPARTMENT, REF: LP/26510460037/02 BATCH:

ASSISTANCE PLEASE

2003-08-14 Thread johnmalanbo
Dear Greetings,I am John Malanbo Vaye {A Liberian}who has just gotten off the hands of Rebels fighting against the regime of President Charles Taylor. My Father who was then a minister in the Cabinet of President Taylor was his confidant in matter of diamond trade between the Sierra Leone

RE: link statically with libc?

2003-08-14 Thread Simon Marlow
Is it possible to link libc statically with GHC? My Linux box has been upgraded, and compiled binaries no longer work on older systems. :-( -optl-static should do the trick. Cheers, Simon ___ Glasgow-haskell-users mailing list [EMAIL

Re: Polymorphic kinds

2003-08-14 Thread Sebastien Carlier
On Tuesday 05 August 2003 4:00 pm, Simon Peyton-Jones wrote: | id# :: (a :: # ) - a | id# x = x That should really be rejected. You couldn't call it because you'd have to instantiate 'a' to Int# or Double#, and that would mean different code for different calls. GHC (after modifying the

Re: link statically with libc?

2003-08-14 Thread Ketil Z. Malde
Simon Marlow [EMAIL PROTECTED] writes: I don't know how the Ada guys do it. Perhaps they have an alternate set of compiled libraries with bounds-checking turned off? Me neither, I've just heard the idea discussed, not the actual technology. I suppose I can do it by wrapping array accesses

link statically with libc?

2003-08-14 Thread Ketil Z. Malde
Hi, Is it possible to link libc statically with GHC? My Linux box has been upgraded, and compiled binaries no longer work on older systems. :-( -kzm -- If I haven't seen further, it is by standing in the footprints of giants ___

URGENT ASSISTANCE

2003-08-14 Thread anthonysanedmunds
ANTHONY EDMUNDS. EMAILl: [EMAIL PROTECTED] FAX:+34 MADRID-SPAIN: Dear Sir AN APPEAL FOR ASSISTANCE My name is Anthony Edmundo a liberian nacional I was a former minister in the Government of President Charles Taylor. I am on the run due to the iminent collapse of the

RE: strange behaviour

2003-08-14 Thread Simon Marlow
My point here is to know, what's the reason for the different behaviour, rather than discussing the correctness of using unsafePerformIO. The reason is this: GHC uses a lazy evaluation strategy, as opposed to fully-lazy. Under lazy evaluation, the unsafePerformIO expression in your example

preemptive getLine on cygwin?

2003-08-14 Thread Claus Reinke
I seem to have some problems understanding preemptive getLine behaviour on cygwin, and wonder whether this is a known/fixed bug/feature (I haven't switched to ghc-6.. yet), or whether anyone has experience with this (behaviour on solaris, with an even older ghc is more or less as expected).

Re: Data.Tree.Tree Show instance

2003-08-14 Thread Ross Paterson
On Mon, Aug 11, 2003 at 07:16:08PM +0200, Tomasz Zielonka wrote: I think it would be better to derive Show instance for Tree instead of providing a pretty printing one. Then it would be possible to have a complementing Read instance. The pretty printing function could be provided under a

Re: preemptive getLine on cygwin?

2003-08-14 Thread Claus Reinke
I seem to have some problems understanding preemptive getLine behaviour on cygwin, and wonder whether this is a known/fixed bug/feature (I haven't switched to ghc-6.. yet), or whether anyone has experience with this (behaviour on solaris, with an even older ghc is more or less as

RE: preemptive getLine on cygwin?

2003-08-14 Thread Simon Marlow
So that's a third variant of runtime behaviour, then, for the same trivial program (probably cygwin on a more modern windows?)!? What do other GHC versions say? And, more importantly, what _should_ they do? GHC 5.04.3 behaves as I'd expect, except that it defaults to BlockBuffering for

Re: Polymorphic kinds

2003-08-14 Thread Sebastien Carlier
On Tuesday 05 August 2003 1:51 pm, Simon Peyton-Jones wrote: The real question is: why does GHC distinguish kind * from kind #? For example, Int has kind * Int# has kind # The main reason is this: a polymorphic function assumes that values of type 'a' are

RE: link statically with libc?

2003-08-14 Thread Hal Daume
I don't know how the Ada guys do it. Perhaps they have an alternate set of compiled libraries with bounds-checking turned off? Me neither, I've just heard the idea discussed, not the actual technology. I know O'Caml does this too (-unsafe as a compiler flag gives you unsafe array

URGENT ASSISTANCE

2003-08-14 Thread anthonyedmunds
ANTHONY EDMUNDS. EMAILl: [EMAIL PROTECTED] FAX:+34 MADRID-SPAIN: Dear Sir AN APPEAL FOR ASSISTANCE My name is Anthony Edmundo a liberian nacional I was a former minister in the Government of President Charles Taylor. I am on the run due to the iminent collapse of the

Re: strange behaviour

2003-08-14 Thread Jon Fairbairn
On 2003-08-11 at 11:44+0200 David Sabel wrote: module Main(main) where import System.IO.Unsafe main = case unsafePerformIO (print test) of () - main ok, probably I use unsafePerformIO in an unsafe way and so on, but executing the program prints infinitely often test

RE: preemptive getLine on cygwin?

2003-08-14 Thread Simon Marlow
I seem to have some problems understanding preemptive getLine behaviour on cygwin, and wonder whether this is a known/fixed bug/feature (I haven't switched to ghc-6.. yet), or whether anyone has experience with this (behaviour on solaris, with an even older ghc is more or less as

Re: Data.Tree.Tree Show instance

2003-08-14 Thread Tomasz Zielonka
On Tue, Aug 12, 2003 at 12:30:27PM +0200, Johannes Waldmann wrote: On Mon, 11 Aug 2003, Tomasz Zielonka wrote: The Tree datatype in new Data.Tree module has a Show instance ... [...] On the other hand, it is my opinion that for a clean program design, you should normally define your own

Re: Data.Tree.Tree Show instance

2003-08-14 Thread Johannes Waldmann
On Mon, 11 Aug 2003, Tomasz Zielonka wrote: The Tree datatype in new Data.Tree module has a Show instance ... I agree that Read/Show should normally come as a pair. It is debatable whether a library should contain a Show instance that makes it rather impossible to write the corresponding Read

Re: Timing repeated function calls

2003-08-14 Thread Jeffrey A. Scofield
Malcom Wallace wrote: Since you aren't interested in absolute timings, just the algorithmic complexity, then you could try using a less smart compiler (e.g. nhc98) which will not automatically optimise away the repeated calls. Thanks very much, I will try this. I'm seriously interested in using

Data.Tree.Tree Show instance

2003-08-14 Thread Tomasz Zielonka
Hi! The Tree datatype in new Data.Tree module has a Show instance that works like shown below: Prelude Data.Tree print (Node 'a' [Node 'b' [], Node 'c' []]) - 'a' -+- 'b' | `- 'c' I use a similar module for Trees in conjunction with WASH for generating web pages. WASH

Re: strange behaviour

2003-08-14 Thread David Sabel
Ok, thanks for all your comments. But I think that the examples haven't much to do with the core-to-core optimisations, because I've also used a modified version --modified be me ;-) -- of ghc5.04.3, where only a modified simplifying is done. The modifications are small: Do Inlining only for

Re: strange behaviour

2003-08-14 Thread David Sabel
On 2003-08-11 at 11:44+0200 David Sabel wrote: module Main(main) where import System.IO.Unsafe main = case unsafePerformIO (print test) of () - main ok, probably I use unsafePerformIO in an unsafe way and so on, but executing the program prints infinitely often test on

RE: link statically with libc?

2003-08-14 Thread Simon Marlow
I must have misremembered it from somewhere, perhaps confusing it with -fliberate-case-threshold mentioned a while ago (which probably belongs in the experimental category?) Turing off bounds checking could be fairly useful, I think, if there is a significant speedup to be gained. My

RE: link statically with libc?

2003-08-14 Thread Simon Marlow
(PS: Am I looking in the wrong places, or are a lot of GHC options undocumented? I seem to remember options being brandished about (turn of array bounds checking, tuning unboxing and stuff) that I'm unable to find documented anywhere.) There might be one or two undocumented optimisation

Re: link statically with libc?

2003-08-14 Thread Ketil Z. Malde
Simon Marlow [EMAIL PROTECTED] writes: -optl-static should do the trick. That worked nicely, thanks! (PS: Am I looking in the wrong places, or are a lot of GHC options undocumented? I seem to remember options being brandished about (turn of array bounds checking, tuning unboxing and stuff)

RE: Polymorphic kinds

2003-08-14 Thread Simon Peyton-Jones
| All right. I do expect the compiler to yell if a polymorphic function is | ever effectively applied to an unboxed value. Does this mean that | forcing kinds to # will not work, for example as in | id# :: (a :: # ) - a | id# x = x That should really be rejected. You couldn't call it because

Re: overlapping instances and functional dependencies

2003-08-14 Thread Andrew J Bromage
G'day all. On Sat, Aug 09, 2003 at 01:32:49AM +0200, Wolfgang Jeltsch wrote: ghci -fglasgow-exts -fallow-overlapping-instances compiles it without complaint If it helps, ghci will complain the first time you actually try to use it. Cheers, Andrew Bromage

CfP: SNPD'03 Workshop on High-Level Approaches to Parallel and Distributed Computing

2003-08-14 Thread Clemens Grelck
Please apologize in case you receive multiple copies of this information. == CALL FOR PAPERS Workshop on High-Level Approaches to Parallel and Distributed Computing held in the context of the

Re: Solution to the monomorphism restriction/implicit parameter problem

2003-08-14 Thread Ben Rudiak-Gould
Complications: * In my examples it's easy to tell whether all uses of the implicit parameter refer to the same explicit binding, but it may be difficult when recursion is involved. This problem has already arisen in the case of type class constraints, and has been solved, so I'm

Re: Haskell and algebra

2003-08-14 Thread Frank Atanassow
Gustavo Villavicencio wrote: Hi all, I am trying to understand the algebraic laws and operators behind a functional expression... f = g \equiv g* . f in the Kleisli Star context. Is this right? Yep. If it is so, can I combine g*.f with a fork for example? What do you mean by a fork?

loop through the list...

2003-08-14 Thread Fredrik Petersson
hi again... :) Ok assume i got this list of tuples [(10,1),(20,2),(30,3)] where i in (i,j) is a index, i want to go through the list and add a number witch matches the best index. Like 18 should give me [(10,1),(20,3),(30,3)] since 18 are over 10 and under 20... aky? something like [if

RE: literate scripts.

2003-08-14 Thread Simon Marlow
Ghc should not accept this code, because, no matter how the unliterating is achieved, it is illegal for a literal string to contain a literal newline character. Known bug in GHC. In the testsuite, but unfortunately not documented. Cheers, Simon

RE: Solution to the monomorphism restriction/implicit parameter problem

2003-08-14 Thread Ben Rudiak-Gould
On Tue, 5 Aug 2003, Simon Peyton-Jones wrote: I'm afraid that I have not read all of the recent exciting flood of messages carefully, Hi, I'm glad to see that you're around, and I'm very much looking forward to any comments you may have about my proposal. You say that All implementations

Implicit parameters, second draft

2003-08-14 Thread Ben Rudiak-Gould
0. Introduction This is a complete rewrite of my implicit-parameter proposal, with a lot more motivating text and examples, as well as discussions of the tradeoffs involved in making various changes to the existing system. It incorporates various changes which came up in the discussion which

Re: Calling Haskell from Java

2003-08-14 Thread Immanuel Litzroth
Brandon == Brandon Michael Moore [EMAIL PROTECTED] writes: Brandon Is it fine if the interface uses JNI? The jvm-bridge is Brandon an excellent tool if you can use JNI thanks, I'll check out the jvm bridge stuff. Brandon What are you trying to do? There was an interesting story

Re: Haskell and algebra

2003-08-14 Thread Gustavo Villavicencio
Frank Atanassow said: Gustavo Villavicencio wrote: Hi all, I am trying to understand the algebraic laws and operators behind a functional expression... f = g \equiv g* . f in the Kleisli Star context. Is this right? Yep. If it is so, can I combine g*.f with a fork

Announce: release candidate 1 of buddha version 1.0

2003-08-14 Thread Bernard James POPE
Announcing buddha version 1.0 release candidate 1 - www.cs.mu.oz.au/~bjpop/buddha Buddha is a declarative debugger for Haskell 98. It is based on program transformation and relies on GHC version 5.04 or greater (but not version 6 yet). It also

RE: overlapping instances and functional dependencies

2003-08-14 Thread Hal Daume
Suppose somewhere we have an instance: instance C Int Bool Int when the first instance decl you have says we also have instance C Int (x,y,Bool) Int in this case, Int + (x,y,Bool) should uniq. specify Int. however, we also have: instance C a (a,c,b) c where, if we let a=Int, b=Bool,

Re: Solution to the monomorphism restriction/implicit parameter problem

2003-08-14 Thread Ben Rudiak-Gould
I wrote: Exactly the same rule should apply to implicit parameters. In the case of implicit parameters, safety is ensured if in every use of the bound variable, its implicit parameter refers to the same explicit binding of that parameter. For example, the expression let g = ?x in

Calling Haskell from Java

2003-08-14 Thread Immanuel Litzroth
Calling Haskell from java was supposed to be supported by a tool called lambada, but all I can seen to find of that on the net is a paper. Does anyone have any pointers to more information/implementation. I specifically want to call Java-Haskell and not the other way around. thanks in advance

Re: literate scripts.

2003-08-14 Thread Malcolm Wallace
Immanuel Litzroth [EMAIL PROTECTED] writes: thanks for your code. Perhaps I was not completely clear in my question: I specifically want to know if unliterating should include lexing so that it recognizes strings (comments) or if it can be a separate phase. The following compiles without

RE: Solution to the monomorphism restriction/implicit parameter problem

2003-08-14 Thread Ben Rudiak-Gould
I wrote: My solution *is* the Right Thing. :-) What I meant is: it always preserves the validity of inlining, it always preserves sharing, and it rejects otherwise-correct programs only in situations which are (I expect) uncommon in practice. -- Ben

ANNOUNCE: Alex version 2.0

2003-08-14 Thread Simon Marlow
I am pleased to announce version 2.0 of Alex, the lexical analyser generator for Haskell. Based on Chris Dornan's original version of Alex, this new version contains some significant changes: - A revised syntax, more closely matching that of lex and Happy. - A rewritten back-end, producing

Re: Calling Haskell from Java

2003-08-14 Thread Brandon Michael Moore
Is it fine if the interface uses JNI? The jvm-bridge is an excellent tool if you can use JNI, but I don't know of anything that compiles Haskell to java bytecode. There was a post a few years ago about an experimental Java backend for GHC, but I haven't heard anything since, and the -J switch

RE: Help with Exceptions on I/O

2003-08-14 Thread Brandon Michael Moore
You don't really need to change the buffering mode. stdout is line buffered by default, so you just need to make sure a newline is printed after your message. putStrLn adds a newline after the string it prints, or you could use \n in the string literal. Try this: main = do --lots of code goes

RE: Help with Exceptions on I/O

2003-08-14 Thread Hal Daume
you can write this a bit more simply as: main = do (do do-the-major stuff here putStr File created...) `catch` (\_ - show the error) getLine-- look ma, no - return () now, your problem is almost certainly with buffering. in the main do, put hSetBuffering stdout

Re: Implicit parameters, second draft

2003-08-14 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Ben Rudiak-Gould [EMAIL PROTECTED] wrote: The proposed notation seems to be almost the same as the existing field-label notation semantically as well as syntactically, which suggests that it wouldn't be a destabilizing addition. (See section 2.5.) Might these be

Haskell and algebra

2003-08-14 Thread Gustavo Villavicencio
Hi all, I am trying to understand the algebraic laws and operators behind a functional expression. So, for example, I can understand that the standard length function is a catamorphism, (| [_0, succ . \pi_2] |) where _0 is a constant function, . is the function composition, \pi_2 is a

ICFP 2003 / PLI 2003 -- final call for participation

2003-08-14 Thread Olin Shivers
The following message is a courtesy copy of an article that has been posted to comp.lang.scheme,comp.lang.scheme.scsh,comp.lang.dylan,comp.lang.functional,comp.lang.lisp,comp.lang.lisp.franz,comp.lang.lisp.mcl,comp.lang.lisp.x,comp.lang.apl,comp.lang.clos as well. ICFP 2003, the International

HI TypeCast

2003-08-14 Thread Fredrik Petersson
Hi there! Iam new to the list so feel free to shout at me when i do wrong! :) Software-designer from sweden, likes fast bikes and metal, thats me, and hi to you all! Yeah ok to the problem, i have this stupid code, [c | (c,i) - l] Where (c,i) are a tuple from a (Char,Int) and l is a [(Char,Int)]

Re: Haskell and algebra

2003-08-14 Thread Frank Atanassow
Gustavo Villavicencio wrote: Frank Atanassow said: What do you mean by a fork? So, the question is, if i have f : A - T B and g : A - T C where T is a monad, i.e. an endofunctor, can i combine f and g as f,g : A - T (BxC) knowing that T involves side effects? I guess you are asking: if

Type class problem

2003-08-14 Thread Brandon Michael Moore
To try some of the examples from paper Recursion Schemes from Comonads, I wanted to define instances of Show and Observable for types defined as the fixed point of a functor. I defined type recursion and naturals as newtype Mu f = In {unIn :: f (Mu f)} data N f = S f | Z type Nat = Mu N An

Re: Calling Haskell from Java

2003-08-14 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Immanuel Litzroth [EMAIL PROTECTED] wrote: Calling Haskell from java was supposed to be supported by a tool called lambada, but all I can seen to find of that on the net is a paper. Lambada is available from Sigbjorn Finne's web-page:

Re: Haskell and algebra

2003-08-14 Thread Frank Atanassow
Frank Atanassow wrote: Gustavo Villavicencio wrote: Hi all, I am trying to understand the algebraic laws and operators behind a functional expression... f = g \equiv g* . f in the Kleisli Star context. Is this right? Yep. Oops, or rather, not quite. m = g means g* m The

Re: Haskell and algebra

2003-08-14 Thread Frank Atanassow
The Kleisli composition (-)* . (-) is sometimes written as (@@): (@@) :: (Monad m) = (b - m c) - (a - m b) - (a - m c) (f @@ g) x = let m = f x in m = g Man, I can't get anything right today. I meant: (g @@ f) x = let m = f x in m = g Apologies for the flooding. Regards, Frank

Re: HI TypeCast

2003-08-14 Thread Iavor Diatchki
hello, Fredrik Petersson wrote: Hi there! Iam new to the list so feel free to shout at me when i do wrong! :) Software-designer from sweden, likes fast bikes and metal, thats me, and hi to you all! welcome Yeah ok to the problem, i have this stupid code, [c | (c,i) - l] Where (c,i) are a tuple

Help with Exceptions on I/O

2003-08-14 Thread Alexandre Weffort Thenorio
I have a program which creates textfiles out of other files. Since theprogram is runned from windows I output some text strings (Like "Filecreated succefully") and I need to stop the program before it quits so thatthe user can read the line outputted to know what went on and then he canpress

Help with Exceptions on I/O

2003-08-14 Thread Alexandre Weffort Thenorio
I have a program which creates textfiles out of other files. Since the program is runned from windows I output some text strings (Like File created succefully) and I need to stop the program before it quits so that the user can read the line outputted to know what went on and then he can press

Re: haskell newbie seeking for advice

2003-08-14 Thread Glynn Clements
Jose A.Ortega Ruiz wrote: as stated in the subject, i'm a newcomer to haskell programming: i've read some tutorials and (portions of) a couple of books and am really fascinated with the language. but my haskell coding experience is limited to toy programs and short exercises. so i decided to

Re: Yet Another Monad Tutorial

2003-08-14 Thread Derek Elkins
On Wed, 13 Aug 2003 13:26:34 +0200 blaat blaat [EMAIL PROTECTED] wrote: I have a long reply, perhaps I'll post it later. Here's a more pragmatic short one. What did we lose? Well, introspection comes to mind. A monad is strange in the sense that, actually, there does not seem to be any

Re: Editor in Linux for Hint/Helium

2003-08-14 Thread Glynn Clements
Tim Stitt wrote: I'm using the Helium interpreter/compiler with the Hint interface within Linux. Unfortunately, I want an editor that allows me to jump to the row/column of the source when I receive an error. Does anyone know of a good editor in Linux to do this or the commands for Emacs

Re: idiom for producing comma-seperated lists?

2003-08-14 Thread Antony Courtney
Ketil Z. Malde wrote: Antony Courtney [EMAIL PROTECTED] writes: -- Example: format a list of strings, using a comma as a seperator: mkSepStr :: [String] - String mkSepStr xs = foldrs (\x s - x ++ , ++ s) xs t0 = mkSepStr [] -- == t1 = mkSepStr [hello]-- == hello

Re: Another typing question

2003-08-14 Thread Konrad Hinsen
On Tuesday 05 August 2003 15:23, Wolfgang Jeltsch wrote: There probably are ways to achieve this with Haskell's type system. The exact solution depends on what exactly you want. For just distinguishing between lists of different lengths you could use tuples like (a,a) (list of length 2)

Re: [newbie] UTF-8

2003-08-14 Thread Marcin 'Qrczak' Kowalczyk
Dnia pon 11. sierpnia 2003 00:49, Wolfgang Jeltsch napisa: The main problem is that you need binary I/O. Haskell 98 only provides text I/O. You don't need binary I/O for UTF-8 now; because implementations use ISO-8859-1, UTF-8 octets can be faked as characters by (chr . fromIntegral). The

Re: IO Bool - Bool

2003-08-14 Thread Brandon Michael Moore
On Thu, 14 Aug 2003, Wolfgang Jeltsch wrote: 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

Re: idiom for producing comma-seperated lists?

2003-08-14 Thread Ketil Z. Malde
Antony Courtney [EMAIL PROTECTED] writes: -- Example: format a list of strings, using a comma as a seperator: mkSepStr :: [String] - String mkSepStr xs = foldrs (\x s - x ++ , ++ s) xs t0 = mkSepStr [] -- == t1 = mkSepStr [hello]-- == hello t2 = mkSepStr

RE: .. Drowning in stateful, side-effect riddled, spaghetti code? We have the answer. fdps[]c.

2003-08-14 Thread Bayley, Alistair
Hey there! Stateful side-effect-laden spaghetti programming sucks, and so does the cost.. feel like your [sic] getting ripped off? ... We tear up your code and give you and your colleagues a fresh start .. - Save you a lot of money by eliminating side-effects - Develop new code in

RE: Database interface

2003-08-14 Thread Tim Docker
[EMAIL PROTECTED] wrote: If I may interject, that's precisely how a Scheme DB interface is designed. The main function is a left-fold. Not quite though: it provides for a premature termination: A major procedure: DB1:fold-left PROC INITIAL-SEED QUERY-OBJECT Premature termination sounds

[String]-[[Bool]] 2

2003-08-14 Thread Tn X-10n
[String] contains = ["1 0 0","1 0 0","0 1 0"] this [String] is read from a file. the file shows only: i convert it by using Lines. but i stuck wif the output. 1 0 0 1 0 0 1 0 1 if 1 then False 0 then True the expected result show be [[False,True,True],[False,True,True],[True,False,True]] My code

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 write

RE: Yet Another Monad Tutorial

2003-08-14 Thread Jeff Newbern
Alistair, Hhhmmm. That is an interesting issue, and I am unsure how to treat it in the tutorial. I did attempt to explain the ability of the monad to isolate impure computations, but I think I need to make a better explanation of what an action is and how it is used. As for the question of

Re: Yet Another Monad Tutorial

2003-08-14 Thread blaat blaat
To many questions, not enough mail. First, thanks for all your replies. Second, I stand totally corrected on the fact that we cannot break down monads. Functions of type m a-b are called impure, see also unsafePerformIO. I am questioning (a) the exact relation between monads, monadic IO, IO in

Re: Yet Another Monad Tutorial

2003-08-14 Thread Antony Courtney
Peter G. Hancock wrote: Jeff Newbern wrote (on Tue, 12 Aug 2003 at 17:20): ? The functions exported from the IO module do not perform I/O themselves. They return I/O actions, which describe an I/O operation to be performed. The I/O actions are combined within the IO monad (in a

AW: Yet Another Monad Tutorial

2003-08-14 Thread Markus . Schnell
The overall message I have taken from your post is that I need to be more precise to convey the correct information and avoid confusion (or worse, misinformation). As I understood it, the tutorial should be instructive. So I would not try to be more precise at the beginning, because too much

RE: Database interface

2003-08-14 Thread oleg
I'll probably generalise the query function to do a fold, rathen than always accumulate a list: doquery :: Process - String - (a - b - IO b) - b - IO b If I may interject, that's precisely how a Scheme DB interface is designed. The main function is a left-fold. Not quite though: it

Re: Yet Another Monad Tutorial

2003-08-14 Thread Dominic Fox
I suspect that tutorials should at some point mention some definitions of monads, monoids et al --- since this is where the power (sorry, QA) comes from. I was reading an overview-for-non-specialists of category theory earlier today, and was surprised by the familiarity of much of it - based

Re: [String] - [[Bool]]

2003-08-14 Thread tahara
i am new wif haskell, i would like to know how can i get a list of string and convert it to a list of a list of bool [String]- [[Bool]] for example a [String] [0 1 0 1 0 1,0 0 0 0 0 0 ,1 0 0 0 1 0] it return true if 0 and false if 1. the [String] is read from a file. map (\x - map

haskell newbie seeking for advice

2003-08-14 Thread Jose A . Ortega Ruiz
hi all, as stated in the subject, i'm a newcomer to haskell programming: i've read some tutorials and (portions of) a couple of books and am really fascinated with the language. but my haskell coding experience is limited to toy programs and short exercises. so i decided to try my hand at a

Re: Yet Another Monad Tutorial

2003-08-14 Thread Jeff Newbern
Peter, Thank you for criticism. This is exactly the kind of feedback I need. The overall message I have taken from your post is that I need to be more precise to convey the correct information and avoid confusion (or worse, misinformation). I should have said that a function which performs a

Re: Another typing question

2003-08-14 Thread Jon Cast
On Tuesday, 2003-08-05, 15:22, CEST, Nick Name wrote: snip This is called dependent types and is not a feature of haskell (nor of any language that I know); there was cayenne (try a google search) but I don't believe it is still mantained. snip BTW, why is there no general interest

Re: IO Bool - Bool

2003-08-14 Thread Adrian Hey
On Thursday 14 August 2003 06:20, Tn X-10n wrote: htmldiv style='background-color:'DIV PBRhai guys/Pis it possible to convert IO Bool to Bool?/DIV/divbr clear=allhrGet 10mb of e-mail space with a href=http://g.msn.com/8HMTENSG/2737??PS=;MSN Hotmail Extra Storage/a at only S$36 per year

Fwd: Re: Yet Another Monad Tutorial

2003-08-14 Thread blaat blaat
From: Derek Elkins [EMAIL PROTECTED] blaat blaat [EMAIL PROTECTED] wrote: [...] However, given that observation, the fact that IO is a monad I find to be a _rather arbitrary design decision_; why not define a small term language which may be passed to the OS? That would be confusing to use or

Outlook

2003-08-14 Thread birene
hey there, i thought you'd like to check this out You really owe it to yourself and your family to take a look, With the money you save, put it towards a new car! --- http://btrack.iwon.com/r.pl?redir=http://[EMAIL PROTECTED]/index.asp?RefID=198478 --- for no more

Re: Yet Another Monad Tutorial

2003-08-14 Thread Jeff Newbern
Hello, I have put up all-in-one archives of the tutorial for people who prefer to read it offline. http://www.nomaware.com/monads/monad_tutorial.tgz and http://www.nomaware.com/monads/monad_tutorial.zip Thanks, Jeff Newbern [EMAIL PROTECTED] __ Do you Yahoo!?

Re: Database interface

2003-08-14 Thread Thomas L. Bevan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I still want to use HaskellDB (or at least the relational calculus part of it), so I was thinking of splitting it into two pieces: a library that submits SQL queries and returns the results (database interface), and a library that constructs

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 False?

Re: Yet Another Monad Tutorial

2003-08-14 Thread Ross Paterson
On Tue, Aug 12, 2003 at 03:04:39PM -0400, Antony Courtney wrote: So then, in your view, what *is* an IO action? One conceptual model is that an IO action with type (IO a) denotes a function of type World - (World,a). But the IO monad is not a state monad, because other agents may change the

RE: IO Bool - Bool

2003-08-14 Thread Kevin S. Millikin
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 False? toFalse :: IO Bool - Bool toFalse x = False Maybe that's not what you had

RE: Yet Another Monad Tutorial

2003-08-14 Thread Bayley, Alistair
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 searches for a file named s, reads its content and takes this content as the result of

Re: IO Bool - Bool

2003-08-14 Thread Keith Wansbrough
PBRhai guys/Pis it possible to convert IO Bool to Bool? No, it's not... and for good reason! See the discussion at http://www.haskell.org/hawiki/ThatAnnoyingIoType and http://www.haskell.org/hawiki/UsingIo In general, the HaWiki has answers to lots of newbie questions like this - you might

  1   2   >