Re: [Haskell-cafe] Functor and Haskell

2009-04-22 Thread Kim-Ee Yeoh
Daryoush Mehrtash-2 wrote: I am not sure I follow how the endofunctor gave me the 2nd functor. As I read the transformation there are two catagories C and D and two functors F and G between the same two catagories. My problem is that I only have one functor between the Hask and List

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-22 Thread Jason Dusek
The question of which column width is right is not a revealing one -- there is little technical or scientific basis to prefer 117 to 80. The line length that we prefer is similarly unenlightening. The number of people who, when pushing for column widths greater than 80, choose 132

[Haskell-cafe] Re: ANN: list-tries-0.0 - first release

2009-04-22 Thread Matti Niemenmaa
Felipe Lessa wrote: On Wed, Apr 22, 2009 at 12:29:05AM +0300, Matti Niemenmaa wrote: Good to hear that it works for someone else, too. (I don't have a new enough version of containers installed myself, after upgrading to 6.10.2.) Just bear in mind that some functions won't work. What exactly

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-22 Thread Jason Dusek
Really, the whole thing makes me wish we had blasphemy laws. If any person, in speaking or in writing, shall indicate a preference for column widths other than 80 or indent characters other than spaces (`0x20`) they shall be compelled to present some science or be subject to

[Haskell-cafe] Being impure within a 'pure' function

2009-04-22 Thread Daniel K.
Hello, imagine the following situation: You want to implement e.g. Dijkstra's algorithm to find a shortest path between nodes u and v in a graph. This algorithm relies heavily on mutating arrays, so the type signature would look something like getDistance :: Graph - Node - Node - IO Int Not

[Haskell-cafe] Trouble with type signatures and type families

2009-04-22 Thread Stephan Friedrichs
Hi, consider the following code: class Foo f where type Bar f :: * type Baz f :: * from :: Bar f - Baz f to :: Baz f - Bar f data Tree a b c = Empty | Tree b c (Tree a b c) (Tree a b c) --singleton :: (Foo f) = Bar f - Tree a (Bar f) (Baz

Re: [Haskell-cafe] Being impure within a 'pure' function

2009-04-22 Thread Eugene Kirpichov
Yes. Use the ST (State Thread) monad. Data.Array.ST, STRef etc. 2009/4/22 Daniel K. anmeldema...@gmail.com: Hello, imagine the following situation: You want to implement e.g. Dijkstra's algorithm to find a shortest path between nodes u and v in a graph. This algorithm relies heavily on

[Haskell-cafe] Re: Trouble with type signatures and type families

2009-04-22 Thread Gleb Alexeyev
You may want to read the comments at http://hackage.haskell.org/trac/ghc/ticket/1897. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Being impure within a 'pure' function

2009-04-22 Thread Jason Dusek
If you want to do raw IO and repackage it as pure, you can use `unsafePerformIO` and friends. It is important to use the `NOINLINE` pragma in that case. -- Jason Dusek |...unsafePerformIO...|

Re: [Haskell-cafe] Being impure within a 'pure' function

2009-04-22 Thread Thomas Davie
On 22 Apr 2009, at 10:38, Daniel K. wrote: Hello, imagine the following situation: You want to implement e.g. Dijkstra's algorithm to find a shortest path between nodes u and v in a graph. This algorithm relies heavily on mutating arrays, so the type signature would look something like

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Miguel Mitrofanov
On 22 Apr 2009, at 13:07, Jon Fairbairn wrote: Miguel Mitrofanov miguelim...@yandex.ru writes: Well, the problem is that every implementor does choose a subset of standart to implement. That's what I'm complaining about. And that's exactly what you (or anybody else) can't do anything

Re[2]: [Haskell-cafe] Being impure within a 'pure' function

2009-04-22 Thread Bulat Ziganshin
Hello Jason, Wednesday, April 22, 2009, 1:14:49 PM, you wrote: there is no any need in unsafePerformIO for array computations - ST monad is exactly what one need here If you want to do raw IO and repackage it as pure, you can use `unsafePerformIO` and friends. It is important to use the

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Jon Fairbairn
Miguel Mitrofanov miguelim...@yandex.ru writes: Well, the problem is that every implementor does choose a subset of standart to implement. That's what I'm complaining about. It's much worse in JavaScript - essential features working differently in Internet Explorer, Firefox, Opera, and

[Haskell-cafe] Issues with IO and FFIs

2009-04-22 Thread Jon Harrop
Does anyone have any comments on the following criticism of some difficulties with FFI, including IO, in Haskell: http://groups.google.com/group/comp.lang.functional/msg/6d650c086b2c8a49?hl=en In particular, is it not always possible to write IO libraries safely in Haskell? -- Dr Jon

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread Duncan Coutts
On Wed, 2009-04-22 at 11:33 +0200, david48 wrote: The default should at least be consistent among cabal install, runghc Setup.hs, installing GHC, Gtk2Hs, and so on. If GHC is installed in /home/myusername/local, Where you choose to install ghc is not related. what does cabal install

Re: [Haskell-cafe] Issues with IO and FFIs

2009-04-22 Thread Bertram Felgenhauer
Jon Harrop wrote: Does anyone have any comments on the following criticism of some difficulties with FFI, including IO, in Haskell: http://groups.google.com/group/comp.lang.functional/msg/6d650c086b2c8a49?hl=en That post conflates two separate questions. 1) binding to foreign libraries

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread david48
On Wed, Apr 22, 2009 at 12:32 AM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Tue, 2009-04-21 at 12:31 +0200, david48 wrote: For what it's worth, It's bothered me often enough that cabal doesn't install globally by default that I had to reinstall ghc in order to solve package

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread david48
On Wed, Apr 22, 2009 at 12:06 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-04-22 at 11:33 +0200, david48 wrote: The default should at least be consistent among cabal install, runghc Setup.hs, installing GHC, Gtk2Hs, and so on. If GHC is installed in

Re: [Haskell-cafe] Issues with IO and FFIs

2009-04-22 Thread Bulat Ziganshin
Hello Jon, Wednesday, April 22, 2009, 1:54:58 PM, you wrote: Does anyone have any comments on the following criticism of some difficulties with FFI, including IO, in Haskell: http://groups.google.com/group/comp.lang.functional/msg/6d650c086b2c8a49?hl=en In particular, is it not always

Re: [Haskell-cafe] ANN: Elerea, another FRP library

2009-04-22 Thread Wolfgang Jeltsch
Am Dienstag, 21. April 2009 17:18 schrieb Patai Gergely: What about evaluation time? If I remember correctly, the values of signals depend on the time when the signal expressions are evaluated. So evaluating them multiple times might lead to different behavior. Is this correct? It is.

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread Duncan Coutts
On Wed, 2009-04-22 at 12:26 +0200, david48 wrote: On Wed, Apr 22, 2009 at 12:06 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-04-22 at 11:33 +0200, david48 wrote: The default should at least be consistent among cabal install, runghc

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread david48
The default should at least be consistent among cabal install, runghc Setup.hs, installing GHC, Gtk2Hs, and so on. If GHC is installed in /home/myusername/local, what does cabal install --global ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: breaking too long lines

2009-04-22 Thread Christian Maeder
Maurí­cio wrote: according the several style guides, lines shouldn't be too long (longer than 78 characters). Since Haskell is usually nice to parse, wouldn't it be interesting to replace a pretty printer program for layout manuals? I saw in your first link that the teacher provided a tool

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Duncan Coutts
On Wed, 2009-04-22 at 12:21 +0200, david48 wrote: Do you know what the problem was exactly? It's possible to get problems with overlap between the user and global package dbs, but the exact same problems can also happen just within the global package db.

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread david48
On Wed, Apr 22, 2009 at 1:01 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Wed, 2009-04-22 at 12:21 +0200, david48 wrote: Lines starting with -- are comments. You need to uncomment the prefix line for it to have an effect. Man do I feel dumb now :) David.

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread Daniel Fischer
Am Mittwoch 22 April 2009 12:06:37 schrieb Duncan Coutts: On Wed, 2009-04-22 at 11:33 +0200, david48 wrote: The default should at least be consistent among cabal install, runghc Setup.hs, installing GHC, Gtk2Hs, and so on. If GHC is installed in /home/myusername/local, Where you choose

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread Victor Nazarov
On Wed, Apr 22, 2009 at 2:06 PM, Duncan Coutts duncan.cou...@worc.ox.ac.ukwrote: On Wed, 2009-04-22 at 11:33 +0200, david48 wrote: The default should at least be consistent among cabal install, runghc Setup.hs, installing GHC, Gtk2Hs, and so on. If GHC is installed in

Re: [Haskell-cafe] Getting the x out

2009-04-22 Thread Cristiano Paris
On Wed, Apr 22, 2009 at 2:49 AM, michael rice nowg...@yahoo.com wrote: How do I get the x out of Just x? Hi Michael, in your code you're using Maybe to inform the caller of safeDivision about an exceptional situation. This way, you made a full coverage of all the input cases and nothing is left

Re: [Haskell-cafe] Non-atomic atoms for type-level programming

2009-04-22 Thread Tillmann Rendel
Hi Claus, thanks for your elaborations. I'm still not convinced that a common name (e.g. TT :. Tr :. Tu :. Te) is a better interface than a common import (e.g. TypeLevel.Bool.True). In both cases, the authors of all modules have to actively collaborate, either to define common names, or to

Re: [Haskell-cafe] Getting the x out

2009-04-22 Thread michael rice
It makes sense, once you understand the terminology. Thanks. Michael --- On Wed, 4/22/09, Cristiano Paris fr...@theshire.org wrote: From: Cristiano Paris fr...@theshire.org Subject: Re: [Haskell-cafe] Getting the x out To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date:

Re: [Haskell-cafe] Getting the x out

2009-04-22 Thread michael rice
Hi Neil, I just tried out Hoogle for the first time and it works great. It seems there are a lot of resources available for Haskell; it just takes time to find out about them and how they work. Thanks. Michael --- On Wed, 4/22/09, Neil Mitchell ndmitch...@gmail.com wrote: From: Neil

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-22 Thread Claus Reinke
Installing executable(s) in /home/david/.cabal/bin why the hell would cabal install binaries in a subdirectory of a hidden directory. Why not /home/david/bin or /home/david/local/bin ? Yes, this is clearly suboptimal but getting agreement on where to put it has not proved easy. There are users

[Haskell-cafe] Using Data.Complex

2009-04-22 Thread michael rice
Just exploring. How to load? Michael [mich...@localhost ~]$ ghci Data.Complex GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. no location info:

Re: [Haskell-cafe] Using Data.Complex

2009-04-22 Thread andy morris
2009/4/22 michael rice nowg...@yahoo.com: Just exploring. How to load? Michael [mich...@localhost ~]$ ghci Data.Complex GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading

[Haskell-cafe] Re: Non-atomic atoms for type-level programming

2009-04-22 Thread Achim Schneider
Tillmann Rendel ren...@cs.au.dk wrote: Hi Claus, thanks for your elaborations. I'm still not convinced that a common name (e.g. TT :. Tr :. Tu :. Te) is a better interface than a common import (e.g. TypeLevel.Bool.True). In both cases, the authors of all modules have to actively

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Achim Schneider
Richard O'Keefe o...@cs.otago.ac.nz wrote: On 21 Apr 2009, at 11:36 pm, Achim Schneider wrote: Richard O'Keefe o...@cs.otago.ac.nz wrote: Some of the right questions are - how many potential whatever users would need to have whatever installed on _some_ machine they do NOT

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread John A. De Goes
That's absurd. You have no way to access private source code, so any decision on what features to exclude from future versions of Haskell must necessarily look at publicly accessible source code. The only alternative is to continuously add, and never remove, features from Haskell, even

Re: [Haskell-cafe] Non-atomic atoms for type-level programming

2009-04-22 Thread Claus Reinke
thanks for your elaborations. I'm still not convinced that a common name (e.g. TT :. Tr :. Tu :. Te) is a better interface than a common import (e.g. TypeLevel.Bool.True). In both cases, the authors of all modules have to actively collaborate, either to define common names, or to define common

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-22 Thread Achim Schneider
Claus Reinke claus.rei...@talk21.com wrote: [...] +1. That, and better error messages: A Verbose-Consequences flag in the config (on by default), resulting in strings like Binaries have been installed to $HOME/.cabal/bin and _not_ symlinked. $HOME/.cabal/bin is not in your $PATH: You will not

Re: [Haskell-cafe] ANN: Elerea, another FRP library

2009-04-22 Thread Patai Gergely
network. Therefore, duplication and merging of identical expressions only affects the performance unless they are hidden in the input signal of a latcher. But isn't the latter a fundamental problem? Of course it is, but I said afterwards that this can be resolved by sampling 'more

Re: [Haskell-cafe] Non-atomic atoms for type-level programming

2009-04-22 Thread Claus Reinke
in case anyone stumbles over my ad-hoc notations, that should have been: module A[type label] where x = undefined :: label module B[type label] where x = undefined :: label module C[type label] where import A[label] import B[label] ok = [A.x,B.x] assuming that: - 'module X[types]' means a

[Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Achim Schneider
Richard O'Keefe et all wrote: [n+k patterns] I'd like to add my two cents: Assuming that UHC's roadmap strives to be H'-compilant in the future, and n+k patterns aren't going to be in H', why bother implementing them? Also, assuming that current H98 code will be ported to H', shouldn't n+k

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread Achim Schneider
Jason Dusek jason.du...@gmail.com wrote: Really, the whole thing makes me wish we had blasphemy laws. If any person, in speaking or in writing, shall indicate a preference for column widths other than 80 or indent characters other than spaces (`0x20`) they shall be

[Haskell-cafe] haxr build failure from cabal

2009-04-22 Thread Jeff Heard
haxr will no longer compile from cabal because of the dependency marked HTTP 1.0. The current version of the library requires HTTP 4000.0.0 as it stands. Can it be updated real quick in hackage? -- Jeff ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread John A. De Goes
Another reason for the 80 character limit: some developers have very poor eyesight, which can be overcome with large monitors and large fonts. This won't work if you have to scroll the code. Regards, John A. De Goes N-BRAIN, Inc. The Evolution of Collaboration http://www.n-brain.net|

Re: [Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread David Leimbach
I've found that some developers have very poor taste in shirts as well, therefore Haskell should have a dress code Sorry I'm not buying 80 characters as a way to address bad eyesight. ;-) I think there's supposed to be technology in the editors to deal with that... just as we can try to find

[Haskell-cafe] Re: haxr build failure from cabal

2009-04-22 Thread Christian Maeder
I think you can pass --preference=HTTP==3001.1.5 to cabal-install 0.6.2, try cabal install haxr --preference=HTTP==3001.1.5 Cheers Christian Jeff Heard wrote: haxr will no longer compile from cabal because of the dependency marked HTTP 1.0. The current version of the library requires HTTP

Re: [Haskell-cafe] haxr build failure from cabal

2009-04-22 Thread Sigbjorn Finne
Hi Jeff, I have an updated and _seemingly_ working version of the haxr codebase, but haven't had a chance to test it more than a gentle poke at the tires. Will see if I can upload commit the bits. --sigbjorn On 4/22/2009 07:37, Jeff Heard wrote: haxr will no longer compile from cabal

[Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread michael rice
I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I understand what they're doing all the way up to the definition of (), which duplicates Prelude function (). To continue following the example, I need to know how to override the Prelude ()

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Ross Mellgren
I think import Prelude hiding (()) does that. -Ross On Apr 22, 2009, at 11:44 AM, michael rice wrote: I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I understand what they're doing all the way up to the definition of (), which

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Tim Wawrzynczak
You can try at the top Import Prelude hiding () On Wed, Apr 22, 2009 at 10:44 AM, michael rice nowg...@yahoo.com wrote: I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I understand what they're doing all the way up to the definition of

Re: [Haskell-cafe] Re: Cabal's default install location

2009-04-22 Thread david48
On Wed, Apr 22, 2009 at 1:28 PM, Victor Nazarov asviraspossi...@gmail.comwrote: Ubuntu/Debian policy seems to be installation into /var/lib/cabal . So it's clear that the whole hierarchy is managed by single tool cabal. Drawback is that you should add /var/lib/cabal/bin into your PATH.

[Haskell-cafe] Problems with Haskell Program Coverage

2009-04-22 Thread Dominic Steinitz
I want to use hpc to check that the ASN.1 library tests cover all the code. When I run it with a set of tests that I *know* don't test certain things, it reports that they have been covered i.e. there are not coloured in the markup that hpc produces. I would have expected a lot of yellow. It

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Dan Weston
Be aware that the do unsugars to (Prelude.), not your (), even if you hide (Prelude.): import Prelude hiding (()) m f = error Call me! main = putStrLn . show $ do [3,4] [5] The desugaring of the do { [3,4]; [5] } is (Prelude.) [3,4] [5] = [5,5], whereas you might

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Ross Mellgren
True enough -- if you really want to redefine the monadic operator, you have to use {-# LANGUAGE NoImplicitPrelude #-} import Prelude hiding ((), (=), return) or something like it, although Michael's example didn't appear to be going quite that far. -Ross On Apr 22, 2009, at 12:37 PM,

[Haskell-cafe] astronomy projects in haskell

2009-04-22 Thread Michael Litchard
I remember reading some website, that dons (probably) posted once. I'd like to find them again for a report I'm doing. So, if you know of any astronomy websites that talk about projects using haskell, please let me know. thanks Michael Litchard ___

Re: [Haskell-cafe] astronomy projects in haskell

2009-04-22 Thread Deniz Dogan
2009/4/22 Michael Litchard mich...@schmong.org: I remember reading some website, that dons (probably) posted once. I'd like to find them again for a report I'm doing. So, if you know of any astronomy websites that talk about projects using haskell, please let me know. thanks Michael

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Jason Dusek
2009/04/22 Miguel Mitrofanov miguelim...@yandex.ru: It's arrogant and disrespectful on the part of the implementors to say that they know better than the committee what features should be part of the language. It's arrogant and disrespectful on the part of the committee to say that they know

Re: [Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread Jason Dusek
2009/04/22 Achim Schneider bars...@web.de: Jason Dusek jason.du...@gmail.com wrote: Really, the whole thing makes me wish we had blasphemy laws. I'll definitely add it to the list of questions should I ever conduct a job interview. Just to test how much backing people have for their zeal.

Re: [Haskell-cafe] haxr build failure from cabal

2009-04-22 Thread Sigbjorn Finne
OK, new release of haxr available via hackage; compilable with ghc-6.10.1 (but may very well have bootstrap issues with 6.10.2 due to 'time' dependency) http://hackage.haskell.org/cgi-bin/hackage-scripts/package/haxr enjoy --sigbjorn Sigbjorn Finne wrote: Hi Jeff, I have an updated and

Re: [Haskell-cafe] astronomy projects in haskell

2009-04-22 Thread Gwern Branwen
On Wed, Apr 22, 2009 at 1:17 PM, Deniz Dogan deniz.a.m.do...@gmail.com wrote: 2009/4/22 Michael Litchard mich...@schmong.org: Could this be what you meant? http://www.absoluteastronomy.com/topics/Haskell_(programming_language) Deniz Dogan That being just a Wikipedia mirror, seems pretty

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Miguel Mitrofanov
On 22 Apr 2009, at 21:19, Jason Dusek wrote: 2009/04/22 Miguel Mitrofanov miguelim...@yandex.ru: It's arrogant and disrespectful on the part of the implementors to say that they know better than the committee what features should be part of the language. It's arrogant and disrespectful on

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread David Leimbach
On Wed, Apr 22, 2009 at 10:19 AM, Jason Dusek jason.du...@gmail.com wrote: 2009/04/22 Miguel Mitrofanov miguelim...@yandex.ru: It's arrogant and disrespectful on the part of the implementors to say that they know better than the committee what features should be part of the language.

Re: [Haskell-cafe] breaking too long lines

2009-04-22 Thread Luke Palmer
On Mon, Apr 20, 2009 at 8:44 AM, Tillmann Rendel ren...@cs.au.dk wrote: However, I would prefer the following Coq-like syntax: data Maybe a = | Just a | Nothing Of course, Coq's inductive syntax is just GADT form: Inductive Maybe a := | Just : a - Maybe a | Nothing : Maybe a. data

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Thomas van Noort
You can hide () from the implicit import of Prelude using: import Prelude hiding (()) Kind regards, Thomas michael rice wrote: I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I understand what they're doing all the way up to the

Re: [Haskell-cafe] Getting the x out

2009-04-22 Thread Jake McArthur
michael rice wrote: Got it! I figured there must be some way to unpack it. If you peek at the thread about getting a value out of IO [1], you will see some similarities. If you look at my response [2], you will see that the functions I suggested for IO are exactly the same as the functions

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread michael rice
Here's what I get: [mich...@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude import Prelude hiding (())

[Haskell-cafe] ANNOUNCE: dataenc 0.12.1.0

2009-04-22 Thread Magnus Therning
I've just uploaded version 0.12.1.0 of dataenc with the following (visible) changes compared to the previous version (0.12): - implementation of a bunch of new encodings: - xxencode - hexadecimal - quoted-printable - python escaping - url encoding - squashing of a bug in the

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Luke Palmer
On Wed, Apr 22, 2009 at 1:47 PM, michael rice nowg...@yahoo.com wrote: Here's what I get: [mich...@localhost ~]$ ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package

Re: [Haskell-cafe] Optimizing unamb by determining the state of a thunk?

2009-04-22 Thread Luke Palmer
On Mon, Apr 20, 2009 at 2:54 PM, Peter Verswyvelen bugf...@gmail.comwrote: I find this very confusing. Is the documentation of seq wrong (should be weak head normal form)? Yes. Weak head normal form is really the only *essential* one. The popular runtimes do not know how to reduce under a

[Haskell-cafe] GADT on the wiki: I'm lost

2009-04-22 Thread Peter Verswyvelen
I was reading the explanation of GADTs on the wikihttp://en.wikibooks.org/wiki/Haskell/GADT , and but can't make any sense of the examples. Sure I understand what a GADT is, but I'm looking for practical examples, and the ones on the wiki seem to show what you *cannot* do with them... For

Re: [Haskell-cafe] GADT on the wiki: I'm lost

2009-04-22 Thread Luke Palmer
On Wed, Apr 22, 2009 at 3:30 PM, Peter Verswyvelen bugf...@gmail.comwrote: I was reading the explanation of GADTs on the wikihttp://en.wikibooks.org/wiki/Haskell/GADT , and but can't make any sense of the examples. Sure I understand what a GADT is, but I'm looking for practical examples,

Re: [Haskell-cafe] Re: Trouble with type signatures and type families

2009-04-22 Thread Stephan Friedrichs
Gleb Alexeyev wrote: You may want to read the comments at http://hackage.haskell.org/trac/ghc/ticket/1897. Wow that's subtle... Thanks a lot! -- Früher hieß es ja: Ich denke, also bin ich. Heute weiß man: Es geht auch so. - Dieter Nuhr ___

[Haskell-cafe] WHNF versus HNF (was: Optimizing unamb by determining the state of a thunk?)

2009-04-22 Thread Peter Verswyvelen
I'm having difficulty to understand the difference between WHNF and HNF. Is this explanationhttp://encyclopedia2.thefreedictionary.com/Weak+Head+Normal+Form the correct one? Or is WHNF and HNF equivalent in Haskell land? The GHC documentation of seq says: Evaluates its first argument to head

Re: [Haskell-cafe] GADT on the wiki: I'm lost

2009-04-22 Thread Jason Dagit
On Wed, Apr 22, 2009 at 2:30 PM, Peter Verswyvelen bugf...@gmail.com wrote: I was reading the explanation of GADTs on the wiki , and but can't make any sense of the examples. Sure I understand what a GADT is, but I'm looking for practical examples, and the ones on the wiki seem to show what

Re: [Haskell-cafe] GADT on the wiki: I'm lost

2009-04-22 Thread Peter Verswyvelen
Yeah that's what I also thought. I tried it first in GHCi, and I got a type error. I tried it again, and it works now. I must have forgotten to reload the file or something, cause I made the wrong conclusion. Duh, mea culpa. On Wed, Apr 22, 2009 at 11:48 PM, Luke Palmer lrpal...@gmail.com wrote:

Re: [Haskell-cafe] Functor and Haskell

2009-04-22 Thread Daryoush Mehrtash
Here F is the identity functor, and G is the list functor. And yes, C=D= category of (a subset of) Haskell types. Are you saying the function that goes from list functor to singleton funtor is a natural transformation? But aren't they functors to different subset of Haskell Types? The Haskell

Re: [Haskell-cafe] GADT on the wiki: I'm lost

2009-04-22 Thread Daniel Fischer
Am Mittwoch 22 April 2009 23:30:35 schrieb Peter Verswyvelen: I was reading the explanation of GADTs on the wikihttp://en.wikibooks.org/wiki/Haskell/GADT , and but can't make any sense of the examples. Sure I understand what a GADT is, but I'm looking for practical examples, and the ones on

Re: [Haskell-cafe] WHNF versus HNF (was: Optimizing unamb by determining the state of a thunk?)

2009-04-22 Thread Daniel Fischer
Am Mittwoch 22 April 2009 23:57:08 schrieb Peter Verswyvelen: I'm having difficulty to understand the difference between WHNF and HNF. Is this explanationhttp://encyclopedia2.thefreedictionary.com/Weak+Head+Normal+For m the correct one? Or is WHNF and HNF equivalent in Haskell land? The GHC

Re: [Haskell-cafe] WHNF versus HNF (was: Optimizing unamb by determining the state of a thunk?)

2009-04-22 Thread Marcin Kosiba
On Wednesday 22 April 2009, Peter Verswyvelen wrote: I'm having difficulty to understand the difference between WHNF and HNF. Is this explanationhttp://encyclopedia2.thefreedictionary.com/Weak+Head+Normal+For m the correct one? Or is WHNF and HNF equivalent in Haskell land? The GHC

Re: [Haskell-cafe] WHNF versus HNF

2009-04-22 Thread Tillmann Rendel
Peter Verswyvelen wrote: The GHC documentation of seq says: Evaluates its first argument to head normal form, and then returns its second argument as the result. I think this should be weak head normal form. I don't think you have any means to evaluate under a binder in Haskell. The weak in

Re: [Haskell-cafe] Functor and Haskell

2009-04-22 Thread Ross Paterson
On Wed, Apr 22, 2009 at 03:14:03PM -0700, Daryoush Mehrtash wrote: The Haskell Wikibooks also says the same thing: Functors in Haskell are from Hask to func, where func is the subcategory of Hask defined on just that functor's types. E.g. the list functor goes from Hask to Lst,

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Duncan Coutts
On Wed, 2009-04-22 at 13:20 +0200, david48 wrote: On Wed, Apr 22, 2009 at 1:01 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: On Wed, 2009-04-22 at 12:21 +0200, david48 wrote: Lines starting with -- are comments. You need to uncomment the

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-22 Thread Richard O'Keefe
On 22 Apr 2009, at 8:09 pm, Jason Dusek wrote: Really, the whole thing makes me wish we had blasphemy laws. If any person, in speaking or in writing, shall indicate a preference for column widths other than 80 or indent characters other than spaces (`0x20`) they shall be

Re: Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

2009-04-22 Thread Jason Dusek
Some material I've read on typography -- can't find the reference now -- suggests ~65 is the best number of characters per line. The advice was, if your page is larger than that, you should make columns. If someone has done some studies with specifically program text, I'd of course be

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread michael rice
OK, I changed the operator from () to (~). When I try to use it I get this: [mich...@localhost ~]$ ghci rand GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking

[Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread Maurí­cio
P.S. We really need such a well written style guide for haskell. Python has this nice PEP (Python Enhancement Proposals). Should we start making our own HEP? We have one: urchin.earth.li/~ian/style/haskell.html Yes, it's good. We should publicise it more. Just a tought: I would

[Haskell-cafe] Re: Overriding a Prelude function?

2009-04-22 Thread Achim Schneider
michael rice nowg...@yahoo.com wrote: OK, I changed the operator from () to (~). When I try to use it I get this: [mich...@localhost ~]$ ghci rand GHCi, version 6.10.1: http://www.haskell.org/ghc/__ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ...

[Haskell-cafe] installing Sqlite3 driver for windows

2009-04-22 Thread Michael P Mossey
I'm working from Real World Haskell, trying to install HDBC and the Sqlite3 driver on Windows XP. It was easy enough to use Cabal to install HDBC. However, for the Sqlite3 driver things get fuzzy. I downloaded hdbc-sqlite3_2.1.0.0.zip, but don't know what I'm supposed to do with it. Also, it

Re: [Haskell-cafe] Re: Overriding a Prelude function?

2009-04-22 Thread michael rice
I'm just copying code from this web page: http://en.wikibooks.org/wiki/Haskell/Understanding_monads Using their initial seed I get this: *Main rollDie 362354 ~ (rollDie ~ rollDie) interactive:1:0:     Couldn't match expected type `t - (t1, t2)'    against inferred

[Haskell-cafe] Where to Cabal Install (was: Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release)

2009-04-22 Thread wren ng thornton
Claus Reinke wrote: Installing executable(s) in /home/david/.cabal/bin why the hell would cabal install binaries in a subdirectory of a hidden directory. Why not /home/david/bin or /home/david/local/bin ? Yes, this is clearly suboptimal but getting agreement on where to put it has not proved

Re: [Haskell-cafe] Re: Overriding a Prelude function?

2009-04-22 Thread michael rice
I forgot the type signiture on the last last: (~) :: (Seed - (a,Seed)) - (Seed - (b,Seed)) - (Seed - (b,Seed)) (~) m n = \seed0 -   let (result1, seed1) = m seed0   (result2, seed2) = n seed1   in (result2, seed2) With it I get this: *Main rollDie 362354 ~ (rollDie ~ rollDie)

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Richard O'Keefe
It's irrelevant, because I _do_ have root access to my machine, How nice to be you. Since the argument is entirely about people who _don't_, your point it? It is clear that the only sensible default is no default. Someone else has said it recently and said it much better. I think the

Re: [Haskell-cafe] Re: Is 78 characters still a good option? Was: breaking too long lines

2009-04-22 Thread wren ng thornton
Maurí­cio wrote: We have one: urchin.earth.li/~ian/style/haskell.html Yes, it's good. We should publicise it more. Just a tought: I would like to see a guide talking about the code itself, not about the presentation. Maybe this is ignored because it's difficult. It's easy to get bad code

Re: [Haskell-cafe] Where to install cabal

2009-04-22 Thread Edward Middleton
Richard O'Keefe wrote: Endusers, of course, might have other preferences, but cabal doesn't (IMHO) cater to them, directly: It caters to distribution packages (or windows installers, or whatever), so cabal's default behaviour is quite irrelevant for those cases. The clear impression I've

Re: [Haskell-cafe] Functor and Haskell

2009-04-22 Thread Kim-Ee Yeoh
Daryoush Mehrtash-2 wrote: singleton :: a - [a] singleton x = [x] Here F is the identity functor, and G is the list functor. And yes, C=D= category of (a subset of) Haskell types. Are you saying the function that goes from list functor to singleton funtor is a natural

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Richard O'Keefe
On 23 Apr 2009, at 2:09 am, John A. De Goes wrote: That's absurd. You have no way to access private source code, Right. so any decision on what features to exclude from future versions of Haskell must necessarily look at publicly accessible source code. Wrong. There is no necessarily

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) -- first release

2009-04-22 Thread Richard O'Keefe
On 23 Apr 2009, at 2:24 am, Achim Schneider wrote: Richard O'Keefe et all wrote: [n+k patterns] I'd like to add my two cents: Assuming that UHC's roadmap strives to be H'-compilant in the future, and n+k patterns aren't going to be in H', why bother implementing them? Haskell' is a