Re: Implementing RefMonads in Haskell without ST,IO

2003-05-30 Thread Derek Elkins
On Thu, 29 May 2003 22:48:05 -0500 Tim Sweeney [EMAIL PROTECTED] wrote: If it's not possible to implement a typesafe RefMonad instance directly in Haskell, without making use of built-in imperative features like IO, then doesn't this refute the claims that monads implement imperative features

Re: Implementing RefMonads in Haskell without ST,IO

2003-05-30 Thread Derek Elkins
On Fri, 30 May 2003 00:00:26 -0500 Tim Sweeney [EMAIL PROTECTED] wrote: Hi Derek, How can one implement RefMonad below directly in Haskell? class Monad m = RefMonad m r | m - r where newRef :: a - m (r a) readRef :: r a - m a writeRef :: r a - a - m () I've been able to

Re: Typesafe MRef with a regular monad

2003-06-05 Thread Derek Elkins
On Wed, 04 Jun 2003 15:19:53 -0700 Ashley Yakeley [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Ashley Yakeley wrote: ] ] Is it possible to actually implement a working instance of RefMonad in ] ] Haskell, without making use of a built-in monad like

Re: Typesafe MRef with a regular monad

2003-06-10 Thread Derek Elkins
On Tue, 10 Jun 2003 11:44:45 -0700 (PDT) [EMAIL PROTECTED] wrote: update :: (Typable b) = FM k - Key k a - b - (FM ...) I didn't know constraints on values are allowed... Given below is the implementation of the required interface, in Haskell98 They aren't presumably as that would (as

Re: Typesafe MRef with a regular monad

2003-06-11 Thread Derek Elkins
On Wed, 11 Jun 2003 09:19:46 +0200 (MET DST) Koen Claessen [EMAIL PROTECTED] wrote: Derek Elkins wrote: | The question (at least to me) is more, 'you can | satisfy the RefMonad interface with STRefs or IORefs, | but those use imperative features under the hood; | can it be satisfied

Re: Stupid wuestion about Monads :)

2003-06-11 Thread Derek Elkins
On Wed, 11 Jun 2003 20:00:00 +0200 Filip [EMAIL PROTECTED] wrote: I have a question :) What should I do if I have something like IO Bool and I need Bool ?? Read the Gentle Introduction http://www.haskell.org/tutorial/ ___ Haskell mailing list

Re: In search of: [a-b] - a - [b]

2003-06-17 Thread Derek Elkins
On Tue, 17 Jun 2003 21:01:57 +0100 Graham Klyne [EMAIL PROTECTED] wrote: I'm convinced I've seen a function like this somewhere: [a-b] - a - [b] but cannot remember where. Or maybe: Monad m = m (a-b) - a - m b ? I could roll my own (*), but I'm trying not to duplicate standard

Re: In search of: [a-b] - a - [b]

2003-06-20 Thread Derek Elkins
On Thu, 19 Jun 2003 18:05:11 +0200 Christian Sievers [EMAIL PROTECTED] wrote: Derek Elkins wrote: flist :: [a-b] - a - [b] flist fs a = map (flip ($) a) fs or much nicer (IMO) flist fs a = map ($ a) fs This is a case where I'd prefer a list comprehension: flist fs

Re: literal default value for an unknown type

2003-07-08 Thread Derek Elkins
On Tue, 8 Jul 2003 23:16:33 -0300 Andre W B Furtado [EMAIL PROTECTED] wrote: Is it possible replace the question mark in the following code in order to make defaultMyType return a don't care value for b? data MyType t = MyType { a :: Int, b :: t} defaultMyType :: MyType defaultMyType =

Re: How to use functions in dll file in Haskell program?

2003-07-18 Thread Derek Elkins
On Fri, 18 Jul 2003 18:29:35 +0800 Liu Junfeng [EMAIL PROTECTED] wrote: Hi__ If there is a function named func with type a-b in a win32 dll file. In Hugs use the primitive declaration: --- primitive prim_func :: a - b func = prim_func

Re: a breaking monad

2003-07-31 Thread Derek Elkins
On Thu, 31 Jul 2003 13:18:40 -0700 Hal Daume [EMAIL PROTECTED] wrote: so, my questions are: does this exist in some other form I'm not aware of? is there something fundamentally broken about this (sorry for the pun)? any other comments, suggestions? This looks like a bizarre rendition of

Re: *safe* coerce, for regular and existential types

2003-07-31 Thread Derek Elkins
Throughout this message you imply, if not outright state, that Dynamics requires unsafeCoerce/unsafePerformIO. This is simply not the case. GHC implements Dynamics with unsafeCoerce, or did last time I checked, but it can easily be implemented using only existentials. (I presume that this

Re: Use of H98 FFI

2003-08-01 Thread Derek Elkins
On 01 Aug 2003 09:44:14 +0200 Peter Thiemann [EMAIL PROTECTED] wrote: I recently had my first exposure to Haskell's FFI when I was trying to compute MD5 and SHA1 hashes using the existing C implementations. In each case, the idea is to make the hash function available as function md5 ::

Re: a breaking monad

2003-08-01 Thread Derek Elkins
On Fri, 1 Aug 2003 12:02:00 +0200 Tomasz Zielonka [EMAIL PROTECTED] wrote: On Thu, Jul 31, 2003 at 05:15:33PM -0400, Derek Elkins wrote: On Thu, 31 Jul 2003 13:18:40 -0700 Hal Daume [EMAIL PROTECTED] wrote: so, my questions are: does this exist in some other form I'm not aware

Re: The madness of implicit parameters: cured?

2003-08-02 Thread Derek Elkins
On Sat, 2 Aug 2003 00:45:07 -0700 (PDT) Ben Rudiak-Gould [EMAIL PROTECTED] wrote: When I first learned about implicit parameters I thought they were a great idea. The honeymoon ended about the time I wrote some code of the formlet ?foo = 123 in expr2, where expr2 used ?foo implicitly, and

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Derek Elkins
I kinda think someone mentioned this, perhaps even you. Or maybe I'm thinking of something else. As I'm feeling too lazy to check the archives, at the risk of saying something stupid or repeating something said, you may want to look at named instances (google should turn something up with a

Re: HI TypeCast

2003-08-08 Thread Derek Elkins
On Wed, 6 Aug 2003 23:24:13 +0200 Fredrik Petersson [EMAIL PROTECTED] 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! Yeah ok to the problem, i have this stupid

Re: help!

2003-08-17 Thread Derek Elkins
On Mon, 18 Aug 2003 10:03:45 +1000 Trouble ... [EMAIL PROTECTED] wrote: Hi! I'm new to this whole programming thing, and I was wondering if someone can help me out with the following question: How do I translate a string into an integer. For example, I need to know how to translate one

Re: container for different types, avoiding boiler plate

2003-08-20 Thread Derek Elkins
On Wed, 20 Aug 2003 08:25:39 -0700 Hal Daume [EMAIL PROTECTED] wrote: I use my 'DynamicMap' type to handle this sort of thing. However, I don't really recommend this approach unless you're very careful. You basically lose out on all nice type checking properties and enter a world of dynamic

Re: lexer puzzle

2003-09-13 Thread Derek Elkins
On Sun, 14 Sep 2003 00:30:40 +0200 Marcin 'Qrczak' Kowalczyk [EMAIL PROTECTED] wrote: Dnia pi_ 12. wrze_nia 2003 20:31, Iavor Diatchki napisa_: what do people think should be the tokens produced by a haskell lexer when applied to the following input: A... A (constructor), then

Re: How can I implement this arrow? Thanks

2003-09-16 Thread Derek Elkins
On Tue, 16 Sep 2003 01:52:03 -0700 Ashley Yakeley [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], Yu Di [EMAIL PROTECTED] wrote: Replying to both: Hi, I want to create an arrow which is essentially data MyArrow a b = MyArrow ((String, a) - (String,b)) I don't think this type

Re: How can I implement this arrow? Thanks

2003-09-16 Thread Derek Elkins
On Tue, 16 Sep 2003 14:32:48 -0500 Yu Di [EMAIL PROTECTED] wrote: What I am trying to do is to use Haskell to simulate some process, and meanwhile collecting information about the data-flow throughout the whole process into the output. The (String, a) example is just a simplified version of

Re: learning to love laziness

2003-09-26 Thread Derek Elkins
On Thu, 25 Sep 2003 12:59:37 -0700 Mark Tullsen [EMAIL PROTECTED] wrote: Haskell has lazy/lifted products and not true products. Aren't lazy products true products? What makes something a product is: fst (x,y) = x snd (x,y) = y for all x and y. This holds with lazy products but not eager

Re: IO behaves oddly if used nested

2003-10-02 Thread Derek Elkins
On Thu, 02 Oct 2003 12:47:15 +0200 Lennart Augustsson [EMAIL PROTECTED] wrote: Alastair Reid wrote: Another question with a trivial answer, what is the result of: main :: IO (IO ()) main = return (putStr Hello World!) It is a computation which, if executed, will print Hello

Re: forkIO implemenation

2003-10-16 Thread Derek Elkins
On Thu, 16 Oct 2003 21:31:26 -0400 Feingold, Jason (WingspanTech) [EMAIL PROTECTED] wrote: [You may want to set your email program to wrap lines on sending and send just plain-text.] I infer from a discussion from March 2002 that concurrency in Haskell is not implemented in native threads, at

Re: ANNOUNCE: attribute 0.1

2003-11-13 Thread Derek Elkins
On Thu, 13 Nov 2003 16:06:24 -0500 Abraham Egnor [EMAIL PROTECTED] wrote: Sorry that I'm too lazy to download the the tar.bz2 and see for myself, but... that applies those functions to a monadic reference. Instances for MRef are provided for both IORef and STRef. Assuming MRef is like

Re: pattern-matching extension?

2003-12-05 Thread Derek Elkins
On Wed, 03 Dec 2003 15:10:07 -0500 Abraham Egnor [EMAIL PROTECTED] wrote: I've occasionally wanted some sort of equivalent of an instanceOf function in haskell, i.e. one that would let me define a function that could dispatch on the type of its argument as well as the value. One option I've

Re: pattern-matching extension?

2003-12-08 Thread Derek Elkins
On Mon, 8 Dec 2003 15:37:46 +1100 Fergus Henderson [EMAIL PROTECTED] wrote: On 05-Dec-2003, Derek Elkins [EMAIL PROTECTED] wrote: Abraham Egnor [EMAIL PROTECTED] wrote: I've occasionally wanted some sort of equivalent of an instanceOf function in haskell, i.e. one that would let me

Re: Why are strings linked lists?

2003-12-08 Thread Derek Elkins
On Mon, 8 Dec 2003 20:59:53 +0100 Wolfgang Jeltsch [EMAIL PROTECTED] wrote: Am Montag, 8. Dezember 2003 15:13 schrieb Tomasz Zielonka: [...] Even in unoptimized, byte-code compiled code? Does GHCi use byte code internally? Yes. What Haskell byte code projects are out there? The

Re: Why are strings linked lists?

2003-12-09 Thread Derek Elkins
On Tue, 09 Dec 2003 10:51:08 + Graham Klyne [EMAIL PROTECTED] wrote: At 15:52 08/12/03 -0500, Derek Elkins wrote: What Haskell byte code projects are out there? The most obvious is the LVM. See Helium though the LVM is not tied to it. I tried to track that down (for a colleague

Re: no continuations

2003-12-30 Thread Derek Elkins
On Tue, 30 Dec 2003 10:38:33 -0800 (PST) Ben Rudiak-Gould [EMAIL PROTECTED] wrote: On Tue, 30 Dec 2003, Scott wrote: Why does Haskell have no continuations? (http://www.haskell.org/hawiki/CoMonad) If continuations are incompatible with non-strict semantics, I'd appreciate an

Re: from array update algorithm to nice Haskell code

2003-12-31 Thread Derek Elkins
On Tue, 30 Dec 2003 23:14:05 +0100, Wolfgang Jeltsch [EMAIL PROTECTED] wrote: [replying indirectly because the original email doesn't seem to have gotten here yet] I have an algorithm which updates one or more arrays in a loop. The update operations depend on the (old) contents of the

Re: [Haskell] hs2lhs

2004-02-14 Thread Derek Elkins
On Sat, 14 Feb 2004 15:25:07 - Stenio [EMAIL PROTECTED] wrote: I need to convert some scripts (hs) to lhs (literate script) and lhs (literate script) to hs using GHC. Can someone help me. GHC comes with an unlit program that will convert lhs to hs files, there's probably also some flag you

[Haskell] integration of functional and imperative programming concepts

2005-03-04 Thread Derek Elkins
for my diploma thesis, I need to find information about integration of functional and imperative programming concepts. Could somebody of you point me to good websites, papers, etc. about this topic? You haven't been too specific about what kinds of things you are looking for. One thing that

Re: [Haskell] same type multiply implementing a class

2007-03-15 Thread Derek Elkins
Wolfgang Jeltsch wrote: Am Donnerstag, 15. März 2007 03:23 schrieb Daniel Mahler: Is there any way for the same type to implement a typeclass multiple ways. You can wrap the type using newtype, thus creating a new type which can implement type class methods differently. This technique is

Re: [Haskell] Articles on the value of strong typing

2007-03-26 Thread Derek Elkins
Casey Hawthorne wrote: You may find the following comment interesting. The mythos of type systems is that they help the programmer. But the reality is compiler and hardware design. Not simply that a fantasy type system is harder to implement, but that a restricted language is easier to

Re: [Haskell] Re: Newbie: what are the advantages of Haskell?

2007-04-27 Thread Derek Elkins
Tony Morris wrote: mike clemow wrote: Troy, As a Java chimp embarking on the Haskell journey myself, I'd be interested in hearing about specific ways that learning Haskell has changed the way you program Java. How do you employ the very interesting concepts that you have learned through your

Re: [Haskell] Re: Newbie: what are the advantages of Haskell?

2007-04-27 Thread Derek Elkins
Albert Y. C. Lai wrote: Derek Elkins wrote: And then you come to Haskell and you -can- say, Give me the something that is not there yet. Please give me the libraries that are not there yet! *duck* We wait for people to need the libraries, then a large amount of delayed work is forced

Re: [Haskell] Newbie help with type-classes

2007-05-11 Thread Derek Elkins
Ryan Ingram wrote: [EMAIL PROTECTED] is better for this type of question. Follow-up is set to it. Here's a test case for the problem I'm having; I'm using runhaskell from ghc v6.6. Problem #1) Without -fallow-undecidable-instances, I get the following error: Constraint is no smaller

Re: [Haskell] Re: ANNOUNCE: Harpy -- run-time code generation library

2007-05-14 Thread Derek Elkins
Dirk Kleeblatt wrote: apfelmus wrote: Note that even currently, your operations cannot be strict in the address a label refers to because this may be determined later than the first use of the label. In other words, your example code fac = do [...] (1) jmp loopTest [...] (2)

Re: [Haskell] Power series in a nutshell

2007-07-12 Thread Derek Elkins
On Thu, 2007-07-12 at 12:49 -0400, Doug McIlroy wrote: For lovers of things small and beautiful, http://www.cs.dartmouth.edu/~doug/powser.html boils down basic operations on power series with numeric coefficients to the bare minimum--each is a one-liner. Included are overloaded arithmetic

[Haskell] AmeroHaskell

2007-11-17 Thread Derek Elkins
[Reply-To set to Haskell-Cafe] At http://www.haskell.org/haskellwiki/AmeroHaskell is a page for a proposed Haskell meeting originally aimed for the south eastern United States. Quite a few people registered interest, but few of them were in the SE. This email is to prompt any more interest in

Re: [Haskell] Bang patterns and declaration order

2007-11-18 Thread Derek Elkins
On Sun, 2007-11-18 at 12:11 -0800, Iavor Diatchki wrote: Hello, I was playing around with bang patterns and I noticed that when combined with asynchronous exceptions they can lead to programs where the order of the declarations in a binding group is important! Here is an example:

Re: [Haskell] Should the following program be accepted by ghc?

2008-01-16 Thread Derek Elkins
On Wed, 2008-01-16 at 09:18 +, J.N. Oliveira wrote: On Jan 16, 2008, at 2:08 AM, Bruno Oliveira wrote: Hello, I have been playing with ghc6.8.1 and type families and the following program is accepted without any type-checking error: data a :=: b where Eq :: a :=: a

[Haskell] ANN: Parsec 3.0.0

2008-03-05 Thread Derek Elkins
This is a first release of the Parsec 3, the Google Summer of Code of Paolo Martini. The main changes are: * The Parser monad has been generalized into a ParserT monad transformer. * The parsers have been generalized to work over a stream of any type, in particular,

Re: [Haskell] Top Level -

2008-08-26 Thread Derek Elkins
On Tue, 2008-08-26 at 19:01 +0400, Bulat Ziganshin wrote: Hello Ashley, Monday, August 25, 2008, 3:12:18 AM, you wrote: Is there any interest in implementing a top level - to run monadic code? yes, definitely. as it's hard to develop real app w/o using global vars, h98 still remains

[Haskell] ANNOUNCE: Parsec 3.1.0

2010-03-03 Thread Derek Elkins
Parsec is a monadic combinator library that is well-documented, simple to use, and produces good error messages. Parsec is not inherently lazy/incremental and is not well-suited to handling large quantities of simply formatted data. Parsec 3 adds to Parsec the ability to use Parsec as a monad

Re: [Haskell] ANNOUNCE: set-monad

2012-06-16 Thread Derek Elkins
On Sat, Jun 16, 2012 at 3:47 AM, Dan Burton danburton.em...@gmail.com wrote: Convenience aside, doesn't the functor instance conceptually violate some sort of law? fmap (const 1) someSet The entire shape of the set changes. fmap (g . h) = fmap g . fmap h This law wouldn't hold given

locating package.conf

2003-06-04 Thread Derek Elkins
After building GHC6.1 from CVS a few days old now, on Win2k with MinGW 3.2, I tested it in the build tree and it worked fine. After performing make install, the GHC completely stopped working because it couldn't find package.conf(.inplace). I eventually tracked it down to a self-described hack

Re: Strange ghci :def failure

2003-06-07 Thread Derek Elkins
On Sat, 07 Jun 2003 20:35:55 +0200 George Russell [EMAIL PROTECTED] wrote: What is wrong here? / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.0, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for

Re: Hello world fails on Win32

2003-12-29 Thread Derek Elkins
On Sun, 28 Dec 2003 21:25:00 +0100 Gour [EMAIL PROTECTED] wrote: Hi! Pls. excuse me for cross-posting - I did not realize that this list is more appropriate for the problem for which I posted a message on users' list. After having problem in building ghc-6.2 from source tarball, I

Re: Hello world fails on Win32

2003-12-31 Thread Derek Elkins
On Tue, 30 Dec 2003 11:24:01 +0100 Gour [EMAIL PROTECTED] wrote: Derek Elkins ([EMAIL PROTECTED]) wrote: Add -v and see what's going on, make sure everything seems right. Failed: C:\GHC\GHC-6.2\gcc -BC:\GHC\GHC-6.2\gcc-lib/ -I. -I. -c c:\windows\tem p\ghc-511675.s -o main.orawSystem

Re: Using Template Haskell for deriving instances

2003-07-15 Thread Derek Elkins
On Tue, 15 Jul 2003 14:49:41 +0200 Carsten Schultz [EMAIL PROTECTED] wrote: Hi, is any workable example code for using Template Haskell to generate instance declarations available, eg the function `genEq' mentioned in the Template Haskell paper? This is a module I made to warmup with TH.

Re: Problem with ghc on Windows ME

2004-01-25 Thread Derek Elkins
On Sun, 25 Jan 2004 22:51:47 -0300 (CLST) andrew cooke [EMAIL PROTECTED] wrote: Any suggestions? Use the -v (or -vN for some digit N) to get verbose output, it should point out exactly where the problem is happening. I'm betting it's some problem finding/using gcc or ld, or potentially an

Re: [Haskell-cafe] Re: Explaining monads

2007-08-13 Thread Derek Elkins
On Mon, 2007-08-13 at 22:29 +0200, Benjamin Franksen wrote: Brian Brunswick wrote: One thing that I keep seeing people say (not you), is that monads /sequence/ side effects. This is wrong, or at least a limited picture. /All/ of the above structures are about combining compatible

RE: [Haskell-cafe] Explaining monads

2007-08-13 Thread Derek Elkins
On Mon, 2007-08-13 at 19:31 +0200, peterv wrote: When I read side-effects, I understand it as unwanted effects, like aliasing, and effects depending on the order of execution. I'm not sure if my understanding here is correct. I hope Haskell does not allow side-effects but only effects, meaning

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Derek Elkins
On Tue, 2007-08-14 at 09:55 -0500, Lanny Ripple wrote: Having just gone through all the tutorials and things (again but this time I think it stuck) the Haskell community is on the wrong track as far as teaching Monads to new programmers. If I were teaching addition and multiplication to

Re: [Haskell-cafe] Explaining monads

2007-08-14 Thread Derek Elkins
On Tue, 2007-08-14 at 12:40 -0500, Lanny Ripple wrote: Derek Elkins wrote: What people need to do is stop reading two page blog posts by someone who's just got monads and read the well-written peer-reviewed papers I have taught many people to program in group settings and individually

Re: [Haskell-cafe] Newbie question: Where is StackOverflow on the Wiki?

2007-08-18 Thread Derek Elkins
On Sat, 2007-08-18 at 20:35 +0200, Peter Verswyvelen wrote: When reading an article about tail recursion (http://themechanicalbride.blogspot.com/2007/04/haskell-for-c-3-programmers. html) I came across the follow statements: If you can write a non-recursive function that uses the colon

Re: [Haskell-cafe] #haskell irc channel reaches 400 users

2007-08-22 Thread Derek Elkins
On Wed, 2007-08-22 at 23:24 +0200, Marc A. Ziegert wrote: i interpret it as this: all [ usage x usage y || fun_to_talk_about x fun_to_talk_about y | let lang=[minBound .. maxBound] -- C++,Haskell,Java,etc. , x-lang , y-lang , irc_channel_users x irc_channel_users y

Re: [Haskell-cafe] help understanding lazy evaluation

2007-08-22 Thread Derek Elkins
[*] Which notation do you use for functions in text? is f() ok? Sure, although a little unusual for Haskell where f() means f applied to the empty tuple. Some people use |f| (generally those who use latex), but generally it can be inferred from the context what is a function Neil's

Re: [Haskell-cafe] GHC optimisations

2007-08-22 Thread Derek Elkins
On Thu, 2007-08-23 at 10:17 +1000, Donald Bruce Stewart wrote: overdrigzed: Using the fromInteger (and fromRational) axioms should only *increase* precission, I don't see how that is such a bad thing. I think it's bad if the behaviour of your program depends on the optimisation

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Derek Elkins
On Sat, 2007-08-25 at 22:51 +0100, Philippa Cowderoy wrote: On Sat, 25 Aug 2007, Andrew Coppin wrote: Would be nice if I could build something in Haskell that overcomes these. OTOH, does Haskell have any way to talk to the audio hardware? It would definitely be nice if someone wrote a

Re: [Haskell-cafe] Ideas

2007-08-25 Thread Derek Elkins
On Sat, 2007-08-25 at 23:36 +0200, [EMAIL PROTECTED] wrote: Evan Laforge writes: Indeed, you can write certain DSP algorithms beautifully in Haskell. Now, if only it could talk to the audio hardware... (Or just use common file formats even.) Oh, that's easy. I wrote an FFI

Re: [Haskell-cafe] Norvig's Sudoku Solver in Haskell

2007-08-26 Thread Derek Elkins
On Sun, 2007-08-26 at 14:50 +0200, manu wrote: Hello, After reading Peter Norvig's take on writing a Sudoku solver (http:// norvig.com/sudoku.html) I decided that I would port his program to Haskell, without changing the algorithm, that'll make a nice exercise I thought and should be

Re: [Haskell-cafe] Newbie terminology for partial application

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 16:29 +0200, Peter Verswyvelen wrote: A while ago I confused currying with partial application, which was pointed out by members of this community, and the wiki pages got adapted so that newbies like me don't make the same mistake twice ;) That's great. Anyway, at the

Re: [Haskell-cafe] quoting in Haskell

2007-08-27 Thread Derek Elkins
On Mon, 2007-08-27 at 17:56 +0200, Peter Verswyvelen wrote: Look at Template Haskell. Intuitively Template Haskell provides new language features that allow us to convert back and forth between concrete syntax, i.e. what Gee coming from C++ that was the last thing I expected templates to

Re: [Haskell-cafe] Haskell on the Playstation 3? :-)

2007-08-29 Thread Derek Elkins
On Thu, 2007-08-30 at 11:34 +0800, Hugh Perkins wrote: On 8/26/07, Peter Verswyvelen [EMAIL PROTECTED] wrote: Game developers are really struggling to get performance out of the Playstation 3 console. This console has a single PowerPC CPU with 6 Cell SPU coprocessors, all running at 3.3GHz.

Re: [Haskell-cafe] let and fixed point operator

2007-08-30 Thread Derek Elkins
On Thu, 2007-08-30 at 18:17 +0200, Peter Hercek wrote: Hi, I find the feature that the construct let x = f x in expr assigns fixed point of f to x annoying. The reason is that I can not simply chain mofifications a variable like e.g. this: f x = let x = x * scale in let x = x

Re: [Haskell-cafe] let and fixed point operator

2007-08-30 Thread Derek Elkins
On Thu, 2007-08-30 at 23:58 +0200, [EMAIL PROTECTED] wrote: Dan Piponi writes: In mathematics, if you write x = f y you mean that these two expressions are equal. In Haskell, if you say x = f y you mean *make* then equal! Haskell is a declarative language, not an imperative

Re: [Haskell-cafe] Learn Prolog...

2007-09-02 Thread Derek Elkins
On Sun, 2007-09-02 at 22:52 +0800, Hugh Perkins wrote: Sooo.. what is the modern equivalent of Prolog? Because no one has said it quite this way: The modern equivalent of Prolog is Prolog. Most of the advancement in logic programming has either been folded back into Prolog or has been advanced

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 14:57 +0200, Henning Thielemann wrote: In the current Haskell Wiki (haskell.org/haskellwiki) I found references to articles of the old Hawiki (haskell.org/hawiki), like OnceAndOnlyOnce and SeparationOfConcerns. Are the files still available somewhere? Bring back HaWiki!

Re: [Haskell-cafe] Closures and pointfree functions

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 19:47 +0200, Lars Oppermann wrote: Dear all, In the Haskell Wiki at http://www.haskell.org/haskellwiki/Closure there is an example for a function returning a closure given as f x = (\y - x + y) Another way to achieve the same effect would be to write f' x = (+)

Re: [Haskell-cafe] Closures and pointfree functions

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 20:44 +0200, Lars Oppermann wrote: Ah, thanks... However, I think I have just become more confused as to what makes a closure a closure. The defining principle seems to go along the lines some kind of context that is enclosed within the closure object. It was argued

Re: [Haskell-cafe] Code from Why Functional Programming Matters

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 15:35 -0400, Andrew Wagner wrote: I've been reading the classic Why functional programming matters paper [1] lately, particularly looking at the alpha beta stuff. I've ported all his code to haskell, but I have a question. His algorithm takes a board position, creates a

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 21:56 +0200, Henning Thielemann wrote: On Tue, 4 Sep 2007, Donald Bruce Stewart wrote: lemming: ... and there was unfortunately no support in porting the stuff. I guess some simple program (perl -p -e 's/{{{/hask/g' :-) could have simplified a lot. Its

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Tue, 2007-09-04 at 09:38 +1200, Daniel McAllansmith wrote: On Tuesday 04 September 2007 08:29, Neil Mitchell wrote: Hi There are two entirely separate issues in this thread - let's not confuse them. 1) The old HaWiki content is good and unavailable. I want it made available, in

Re: [Haskell-cafe] Hawiki articles

2007-09-03 Thread Derek Elkins
On Mon, 2007-09-03 at 23:50 +0200, Henning Thielemann wrote: On Mon, 3 Sep 2007, Derek Elkins wrote: The issue is that we don't know what the license is for the -content- of HaWiki. HaskellWiki explicitly states that all the content in it has a specific license. We can't take the old

Re: [Haskell-cafe] Learn Prolog...

2007-09-04 Thread Derek Elkins
On Wed, 2007-09-05 at 13:21 +1000, Thomas Conway wrote: On 9/2/07, Andrew Coppin [EMAIL PROTECTED] wrote: One of standard exercices in Prolog is the construction of the meta-interpreter of Prolog in Prolog. While this is cheating, I recommend it to you. It opens eyes. Ever tried

Re: [Haskell-cafe] Help understanding type error

2007-09-07 Thread Derek Elkins
On Sat, 2007-09-08 at 12:24 +1000, Stuart Cook wrote: On 9/8/07, Ryan Ingram [EMAIL PROTECTED] wrote: This does what you want, I think: {-# LANGUAGE ExistentialQuantification #-} module Exist where data Showable = forall a. (Show a) = Showable a instance Show Showable where

Re: [Haskell-cafe] Custom unary operator extension?

2007-09-09 Thread Derek Elkins
On Sun, 2007-09-09 at 15:09 +0200, Peter Verswyvelen wrote: Why? What is your application? In fact, alphanumeric identifiers are used as unary operators. Why? Well, why are binary operators allowed and unary operators not? Isn't that some kind of discrimination? In math, many many

Re: [Haskell-cafe] Speed of character reading in Haskell

2007-09-09 Thread Derek Elkins
On Mon, 2007-09-10 at 00:49 +0100, Neil Mitchell wrote: Hi (Some list operations are too expensive with ByteString but for most string processing it's perfectly fine and much faster than String). I'm sure it's true, but it's quite irrelevant to my question, which is why is using

Re: [Haskell-cafe] Comments and/or Criticisms

2007-09-10 Thread Derek Elkins
On Mon, 2007-09-10 at 15:47 +1000, Stuart Cook wrote: On 9/10/07, PR Stanley [EMAIL PROTECTED] wrote: Hi Any comments and/or criticisms would be most appreciated: --count the occurrences of char in string countC :: Char - [Char] - Int countC x xs = sum [1 | c - xs, c == x] That's a

Re: [Haskell-cafe] Is take behaving correctly?

2007-09-11 Thread Derek Elkins
On Tue, 2007-09-11 at 16:48 -0700, Don Stewart wrote: byorgey: On 9/11/07, Don Stewart [EMAIL PROTECTED] wrote: byorgey: On 9/11/07, PR Stanley [EMAIL PROTECTED] wrote: Hi take 1000 [1..3] still yields [1,2,3] I thought it

Re: [Haskell-cafe] Re: Monad.Reader 8: Haskell, the new C++

2007-09-12 Thread Derek Elkins
On Wed, 2007-09-12 at 23:36 +, Aaron Denney wrote: On 2007-09-12, Don Stewart [EMAIL PROTECTED] wrote: ok: I've been told that functional dependencies are old hat and there is now something better. I suspect that better here means worse. Better here means better -- a functional

Re: [Haskell-cafe] Monad.Reader 8: Haskell, the new C++

2007-09-13 Thread Derek Elkins
On Thu, 2007-09-13 at 11:12 -0700, Don Stewart wrote: Better here means better -- a functional language on the type system, to type a functional language on the value level. -- Don For a taste, see Instant Insanity transliterated in this functional language:

Re: [Haskell-cafe] MonadGL - Partitioning effects without giving up type inference

2007-09-13 Thread Derek Elkins
On Thu, 2007-09-13 at 19:34 +0100, Jules Bean wrote: Any comments? I'm sure this has been shown before but I don't remember where. The Monad Transformer Library essentially does this, the types you get are along the lines of: foo :: (Monad m, MonadState s m, MonadReader r m) = m Int

Re: [Haskell-cafe] transparent parallelization

2007-09-18 Thread Derek Elkins
On Tue, 2007-09-18 at 18:13 +0200, Thomas Girod wrote: Hi there. Beeing rather new to the realm of Haskell and functional programming, I've been reading about how is easier it is to parallelize code in a purely functional language (am I right saying that ?). My knowledge of parallelization

Re: [Haskell-cafe] are some of these reverse algos better than others? is there a quick and dirty way to reveal this fact?

2007-09-22 Thread Derek Elkins
On Sat, 2007-09-22 at 21:14 -0700, Thomas Hartman wrote: I came up with the following functions to do reverse. The first one is obviously bad, because of the expensive list concat. The last one, myreverse, I think is the reference implementation you get in the prelude. The ones between, I'm

Re: [Haskell-cafe] Re: [Haskell] Math behind Haskell

2007-09-23 Thread Derek Elkins
On Sun, 2007-09-23 at 20:03 -0400, Cale Gibbard wrote: On 23/09/2007, Neil Mitchell [EMAIL PROTECTED] wrote: Hi The haskell-cafe@ mailing list is more appropriate for messages such as this. haskell@ is just for announcements (it should be called haskell-annouce@ !) * Lambda

Re: [Haskell-cafe] Composition Operator

2007-09-24 Thread Derek Elkins
On Mon, 2007-09-24 at 19:11 -0700, Dan Weston wrote: Well, I did footnote in my first e-mail that: [1] I used the asterisk in the category name Hask* to exclude undefined values or partial functions [Although I think I may have flipped the asterisk convention.] I see what you mean by

Re: [Haskell-cafe] Re: Very crazy

2007-09-25 Thread Derek Elkins
On Tue, 2007-09-25 at 12:24 +0100, Andrew Coppin wrote: Chaddaï Fouché wrote: 2007/9/25, Andrew Coppin [EMAIL PROTECTED]: This is why I found it so surprising - and annoying - that you can't use a 2-argument function in a point-free expression. For example, zipWith (*) expects two

Re: [Haskell-cafe] Pierce on type theory and category theory

2007-09-25 Thread Derek Elkins
On Tue, 2007-09-25 at 16:18 -0500, Creighton Hogg wrote: On 9/25/07, Philippa Cowderoy [EMAIL PROTECTED] wrote: On Tue, 25 Sep 2007, Seth Gordon wrote: Are Benjamin C. Pierce's _Types and Programming Languages_ and/or _Basic Category Theory for

Re: [Haskell-cafe] Re: Very crazy

2007-09-26 Thread Derek Elkins
On Wed, 2007-09-26 at 18:50 -0400, Steven Fodstad wrote: Andrew Coppin wrote: Chaddaï Fouché wrote: 2007/9/25, Andrew Coppin [EMAIL PROTECTED]: This is why I found it so surprising - and annoying - that you can't use a 2-argument function in a point-free expression. For example,

Re: [Haskell-cafe] Haskell Cheat Sheet?

2007-09-26 Thread Derek Elkins
On Wed, 2007-09-26 at 17:23 -0700, Dan Weston wrote: Not to beat a dead horse, but I wasn't suggesting to rename the fix function that everyone knows and loves: fix :: (a - a) - a fix f = let f' = f f' in f' I was merely trying to suggest that it would be wise to rename the function in

Re: [Haskell-cafe] Order of Declaration

2007-09-29 Thread Derek Elkins
On Sat, 2007-09-29 at 17:58 +0100, PR Stanley wrote: Hi in C type languages a function must be declared before its application. Would I be right in thinking that this isn't the case in Functional languages? For example: transmit :: String - String transmit = decode . channel . encode

Re: [Haskell-cafe] Assignment, Substitution or what?

2007-10-02 Thread Derek Elkins
On Wed, 2007-10-03 at 01:42 +0100, PR Stanley wrote: f x = x + x Is the x use to create a pattern in the definition and when f is called it's replaced by a value? Those equation-like definitions are syntactic sugar for lambda abstractions. f could as well be defined as f = \x -

Re: [Haskell-cafe] Curry and uncurry

2007-10-03 Thread Derek Elkins
On Wed, 2007-10-03 at 22:31 +1000, Stuart Cook wrote: On 10/3/07, PR Stanley [EMAIL PROTECTED] wrote: Without looking at the standard prelude, define the higher-order library function curry that converts a function on pairs into a curried function, and

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-08 Thread Derek Elkins
On Mon, 2007-10-08 at 20:54 +1000, Thomas Conway wrote: I just had a conversation today that seems relevant to this thread. I was chatting with a friend who is working in the academic sector, and I was observing that Melbourne Uni (my old school), is switching in the new year from teaching

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-10 Thread Derek Elkins
On Wed, 2007-10-10 at 23:48 +0100, Philippa Cowderoy wrote: On Wed, 10 Oct 2007, Andrew Coppin wrote: (I'm less sold on whether you really need to learn a particular dialect well enough to *program* in it...) If you don't then you won't be able to see how complicated things actually

  1   2   3   4   5   6   >