[Haskell-cafe] Multi-param typeclass vs locally constrained typeclass methods

2013-09-18 Thread Jacques Carette
Could someone please explain what the difference (if any!), in semantics is between class Foo f = Bar f g where method1 :: f a - g a and class Bar' g where method2 :: Foo f = f a - g a ? Maybe the translation of the above to something lower level might help. [Note: f a - g a is just

Re: [Haskell-cafe] Multi-param typeclass vs locally constrained typeclass methods

2013-09-18 Thread Roman Cheplyaka
* Jacques Carette care...@mcmaster.ca [2013-09-18 08:21:51-0400] Could someone please explain what the difference (if any!), in semantics is between class Foo f = Bar f g where method1 :: f a - g a and class Bar' g where method2 :: Foo f = f a - g a Bar is more flexible than

Re: [Haskell-cafe] Multi-param typeclass vs locally constrained typeclass methods

2013-09-18 Thread Jacques Carette
On 13-09-18 08:54 AM, Roman Cheplyaka wrote: * Jacques Carette care...@mcmaster.ca [2013-09-18 08:21:51-0400] Could someone please explain what the difference (if any!), in semantics is between class Foo f = Bar f g where method1 :: f a - g a and class Bar' g where method2 :: Foo f = f

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread Richard A. O'Keefe
On 3/09/2013, at 5:17 PM, damodar kulkarni wrote: I didn't want to clutter that thread so I am asking a question here. Where do I find foundational and/or other good references on the topic of stream interface vs string interface to convert objects to text? I tried google but failed

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread damodar kulkarni
. Where do I find foundational and/or other good references on the topic of stream interface vs string interface to convert objects to text? I tried google but failed. It has to do with the cost of string concatenation. Let's take a simple thing. A Set of Strings. Smalltalk has String

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread oleg
For lazy I/O, using shows in Haskell is a good analogue of using #printOn: in Smalltalk. The basic form is include this as PART of a stream, with convert this to a whole string as a derived form. What the equivalent of this would be for Iteratees I don't yet understand. Why not to try

[Haskell-cafe] stream interface vs string interface: references

2013-09-02 Thread damodar kulkarni
want to clutter that thread so I am asking a question here. Where do I find foundational and/or other good references on the topic of stream interface vs string interface to convert objects to text? I tried google but failed. I am looking for pointers that explain the rational behind the above claim

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-09-01 Thread Neil Mitchell
Hi, Hoogle is definitely not deprecated. The reason you can't yet search all packages simultaneously is that it consumes too many resources - the number of Haskell packages exploded at a time when I wasn't able to spend enough time to allow Hoogle to keep up. It's definitely something on the todo

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Johannes Waldmann
Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk writes: I always thought [hayoo] was just Hoogle with more indexed docs. Wait - there's a semantic difference: hoogle does understand type signatures (e.g., it can specialize them, or flip arguments of functions) while hayoo just treats signatures

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Erik Hesselink
On Thu, Aug 22, 2013 at 9:23 PM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: On 22/08/13 19:30, jabolo...@google.com wrote: Hi, I noticed Hayoo appears as a link in the toolbox of http://hackage.haskell.org and also that Hayoo seems to display better results than Hoogle. For example,

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Daniel Trstenjak
On Fri, Aug 23, 2013 at 10:12:27AM +0200, Erik Hesselink wrote: Note that the 'normal' hoogle indexes all (?) of hackage. But by default it only searches the haskell platform. You can add a package with '+' to search in that package. E.g. PublicKey +crypto-api. If the idea behind this, that

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread jabolopes
It's a bit pointless, if I have to know the package, where I want to search in. Yeah! It does sound a bit pointless. Hoogle should search everything by default, and then you can refine your search by clicking on the '+' or '-' on the packages that appear on the left menu. Jose -- Jose

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Mateusz Kowalczyk
On 23/08/13 14:57, jabolo...@google.com wrote: It's a bit pointless, if I have to know the package, where I want to search in. Yeah! It does sound a bit pointless. Hoogle should search everything by default, and then you can refine your search by clicking on the '+' or '-' on the packages

[Haskell-cafe] Hoogle vs Hayoo

2013-08-22 Thread jabolopes
Hi, I noticed Hayoo appears as a link in the toolbox of http://hackage.haskell.org and also that Hayoo seems to display better results than Hoogle. For example, if you search for 'PublicKey' in Hayoo, you will get several results from Hackage libraries, such as, 'crypto-pubkey' and 'crypto-api'.

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-22 Thread Mateusz Kowalczyk
On 22/08/13 19:30, jabolo...@google.com wrote: Hi, I noticed Hayoo appears as a link in the toolbox of http://hackage.haskell.org and also that Hayoo seems to display better results than Hoogle. For example, if you search for 'PublicKey' in Hayoo, you will get several results from Hackage

Re: [Haskell-cafe] HSpec vs Tasty (was: ANN: hspec-test-framework - Run test-framework tests with Hspec)

2013-08-21 Thread Andrey Chudnov
So is there a high-level comparison of HSpec and tasty? The only difference I've glimpsed so far was that HSpec has a syntactic sugar for describing tests which, honestly, I haven't found very useful. So, could someone write up a quick comparison of the two for the benefit of the folks like me

[Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Albert Y. C. Lai
When I was writing http://www.vex.net/~trebla/haskell/crossroad.xhtml I wanted to write: branching on predicates and then using selectors is less efficient than pattern matching, since selectors repeat the tests already done by predicates. It is only ethical to verify this claim before

Re: [Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Edward Z. Yang
Note that, unfortunately, GHC's exhaustiveness checker is *not* good enough to figure out that your predicates are covering. :o) Perhaps there is an improvement to be had here. Edward Excerpts from Albert Y. C. Lai's message of Mon Apr 22 00:51:46 -0700 2013: When I was writing

[Haskell-cafe] Data.StorableVector vs Data.Vector.Storable

2013-03-24 Thread Roman Cheplyaka
What is the relationship between these two modules? Do we really need both? (Data.Vector.Storable is part of vector, Data.StorableVector is from a separate package, storablevector.) Roman ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Data.StorableVector vs Data.Vector.Storable

2013-03-24 Thread Ivan Lazar Miljenovic
On 25 March 2013 05:04, Roman Cheplyaka r...@ro-che.info wrote: What is the relationship between these two modules? Do we really need both? There doesn't seem to be any relationship at all between them... (Data.Vector.Storable is part of vector, Data.StorableVector is from a separate

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Atsuro Hoshino
for Haskell libraries. It is a simple one: functional object data structures encapsulating mutable state VS type classes encapsulating mutable state Here is a simple example. I present an API: using a type class `FooC`, and aso as a data structure `FooT`. Both are stateful, in the form of an MVar

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Edsko de Vries
What is the advance of using type classes? A function of the form f :: Show a = ... really has an implicit argument f :: Show__Dict a - ... that the compiler infers for us. So, the advantage of type classes is one of convenience: we don't have to pass dictionaries around, or even figure

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Joey Adams
On Mon, Mar 4, 2013 at 5:50 PM, Rob Stewart robstewar...@gmail.com wrote: ... - import Control.Concurrent -- API approach 1: Using type classes class FooC a where mkFooC :: IO a readFooC :: a - IO Int incrFooC :: a - IO () I recommend taking 'mkFooC' out of the typeclass. It

[Haskell-cafe] Library API design: functional objects VS type classes

2013-03-04 Thread Rob Stewart
Hi, I have a question about API design for Haskell libraries. It is a simple one: functional object data structures encapsulating mutable state VS type classes encapsulating mutable state Here is a simple example. I present an API: using a type class `FooC`, and aso as a data structure `FooT

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-04 Thread Jan Stolarek
Of course that is fine. But keep in mind that all parser combinator based libraries are based on a top-down parsing strategy which in most places, BUT NOT ALL, fits Haskell's syntax. Try to use the chaining combinators where-ever possible. In case of doubt you can always spy on how things are

Re: [Haskell-cafe] Parsec Vs. src exts

2013-02-03 Thread Stephen Tetley
On 2 February 2013 20:08, Sean Cormican seancormic...@gmail.com wrote: Can anybody provide me with some guidance on whether to try and create the parser using Parsec or if haskell-src is a better option. In the case that haskell-src is a better option, are there any tutorials or documents

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-03 Thread Jan Stolarek
Dnia niedziela, 3 lutego 2013, Doaitse Swierstra napisał: Use the uu-parsinglib library, which provides error messages, repairs your errors and using its idioms definition you can even write: inParens c = iI '(' c ')' Ii I think you cannot get it shorter and with more functionality.

Re: [Haskell-cafe] Parsec Vs. src exts

2013-02-03 Thread Patrick Pelletier
On 2/3/13 12:27 AM, Stephen Tetley wrote: Haskell-src-exts parses real Haskell - including most (if not all?) GHC extensions. If you were wanting to analyze 'in the wild' Haskell projects you might also want to use CPPHS as many Haskell projects use the CPP preprocessor. That was something

Re: [Haskell-cafe] Parsec Vs. src exts

2013-02-03 Thread Roman Cheplyaka
* Patrick Pelletier c...@funwithsoftware.org [2013-02-03 10:57:14-0800] On 2/3/13 12:27 AM, Stephen Tetley wrote: Haskell-src-exts parses real Haskell - including most (if not all?) GHC extensions. If you were wanting to analyze 'in the wild' Haskell projects you might also want to use CPPHS

[Haskell-cafe] Parsec Vs. src exts

2013-02-02 Thread Sean Cormican
Hi, I've been spending a bit of time looking into using Parsec as a parser for a subset of the syntax of the Haskell language, a high level description of what I'm looking to create is a parser which confirms whether a given Haskell code file is valid or in the case that it isn't returns some

Re: [Haskell-cafe] Parsec Vs. src exts

2013-02-02 Thread Roman Cheplyaka
Hi Sean, 1. Please do not confuse haskell-src and haskell-src-exts. You should definitely use the latter. I also find it relatively well documented. 2. If your goal is to write a tool and not to write a Haskell parser as an exercise, then I would recommend haskell-src-exts. Another option

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-02-02 Thread Doaitse Swierstra
On Jan 31, 2013, at 10:47 , Jan Stolarek jan.stola...@p.lodz.pl wrote: Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the code is definitely less

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Jan Stolarek
Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the code is definitely less readable than in example I provided. There is one more thing that bothers me.

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Ertugrul Söylemez
Jan Stolarek jan.stola...@p.lodz.pl wrote: Thanks for replies guys. I indeed didn't notice that there are monads and applicatives used in this parser. My thought that monadic parsers are more verbose came from Hutton's paper where the code is definitely less readable than in example I

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Sean Leather
On Wed, Jan 30, 2013 at 1:21 PM, Jan Stolarek wrote: I will be writing a parser in Haskell and I wonder how to approach the problem. Utrecht University has a course that covers this, among other things. You might find the slides and lecture notes useful:

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread Jan Stolarek
Dnia czwartek, 31 stycznia 2013, Ertugrul Söylemez napisał: Remember that 'Either e' is also a monad. =) I remember - this makes the change from Maybe to Either very easy :) Still I found that adding error message to every combinator and function ads a lot of boilerplate. Also, I experince

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-31 Thread wren ng thornton
On 1/30/13 7:21 AM, Jan Stolarek wrote: I will be writing a parser in Haskell and I wonder how to approach the problem. My first thought was to use monadic parser, e.g. like the one described by Hutton and Meijer in Monadic Parsing in Haskell functional pearl. But then I stumbled upon this:

[Haskell-cafe] Monadic parser vs. combinator parser

2013-01-30 Thread Jan Stolarek
I will be writing a parser in Haskell and I wonder how to approach the problem. My first thought was to use monadic parser, e.g. like the one described by Hutton and Meijer in Monadic Parsing in Haskell functional pearl. But then I stumbled upon this:

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-30 Thread Ertugrul Söylemez
Jan Stolarek jan.stola...@p.lodz.pl wrote: I will be writing a parser in Haskell and I wonder how to approach the problem. My first thought was to use monadic parser, e.g. like the one described by Hutton and Meijer in Monadic Parsing in Haskell functional pearl. But then I stumbled upon

Re: [Haskell-cafe] Monadic parser vs. combinator parser

2013-01-30 Thread Stephen Tetley
On 30 January 2013 12:38, Ertugrul Söylemez e...@ertes.de wrote: A monadic parser /is/ a combinator parser. The code you linked just doesn't go as far as wrapping it up with a newtype and providing a monad instance. Further, (+) in the linked example is monadic bind and `result` is

Re: [Haskell-cafe] DIY vs as-a-Service with MemCachier

2013-01-17 Thread Jason Dusek
2013/1/17 Kazu Yamamoto k...@iij.ad.jp: The following blog post by Joyent is worth reading: http://joyent.com/blog/diy-vs-as-a-service-with-memcachier We don't really believe in Node.js (Go Haskell are our choices), so that is a small concern to us, but everyone has

Re: [Haskell-cafe] DIY vs as-a-Service with MemCachier

2013-01-17 Thread Vo Minh Thu
2013/1/17 Jason Dusek jason.du...@gmail.com: 2013/1/17 Kazu Yamamoto k...@iij.ad.jp: The following blog post by Joyent is worth reading: http://joyent.com/blog/diy-vs-as-a-service-with-memcachier We don't really believe in Node.js (Go Haskell are our choices), so

[Haskell-cafe] DIY vs as-a-Service with MemCachier

2013-01-16 Thread 山本和彦
Hello, The following blog post by Joyent is worth reading: http://joyent.com/blog/diy-vs-as-a-service-with-memcachier We don't really believe in Node.js (Go Haskell are our choices), so that is a small concern to us, but everyone has their failings. --Kazu

Re: [Haskell-cafe] isLetter vs. isAlpha

2012-11-23 Thread wren ng thornton
On 11/21/12 4:59 PM, Artyom Kazak wrote: I saw a question on StackOverflow about the difference between isAlpha and isLetter today. One of the answers stated that the two functions are interchangeable, even though they are implemented differently. I decided to find out whether the difference in

[Haskell-cafe] isLetter vs. isAlpha

2012-11-21 Thread Artyom Kazak
Hello! I saw a question on StackOverflow about the difference between isAlpha and isLetter today. One of the answers stated that the two functions are interchangeable, even though they are implemented differently. I decided to find out whether the difference in implementation influences

[Haskell-cafe] Empirically comparing strict vs. lazy evaluation

2012-10-29 Thread Kristopher Micinski
Hello Haskellers! I wonder if you know of benchmarks that attempt to compare, empirically, lazy vs. eager evaluation. Pointers to papers and/or code would be most appreciated. Our group (at UMD) is working on a paper that develops some technology for lazy programs, and we would like to choose

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-11 Thread Eugene Kirpichov
Hi Mark, Thank you for the clarification. I think, then, that we should indeed provide a link to a notice about native libraries - like, if you're using native libraries, make sure their architecture is 32-bit or universal as well; in case of MacPorts you can achieve this by doing port install

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-09 Thread Christiaan Baaij
I've filed a bug report: http://hackage.haskell.org/trac/ghc/ticket/7314 My only problem is that I don't have OS X 10.8 installed on my machine. I'm running OS X 10.6, and am not inclined to upgrade. So providing feedback on the questions related to the bug report will be hard and/or take some

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread Christiaan Baaij
Hi, I finally found another OS X mountain lion install and can confirm the behaviour I described earlier: 32-bit: compiled code works, interpreted code works 64-bit: compiled code works, interpreted code fails Here's the test case: - cabal install gloss --flags-GLUT GLFW - cabal unpack

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread brandon s allbery kf8nh
On Monday, 8 October 2012 at 06:28, Christiaan Baaij wrote: ghci: segfault ghci from gdb: everything works This makes me suspect something that gets disabled when debugging, such as address space randomization and the like. I did not think ML handled that any differently from Lion, though.

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread Johan Tibell
On Mon, Oct 8, 2012 at 3:28 AM, Christiaan Baaij christiaan.ba...@gmail.com wrote: Hi, I finally found another OS X mountain lion install and can confirm the behaviour I described earlier: 32-bit: compiled code works, interpreted code works 64-bit: compiled code works, interpreted code

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread Eugene Kirpichov
Johan, should I also file the bugreport remove the suggestion to install 32-bit platform there, or is there a different place for bugs of the platform website? On Mon, Oct 8, 2012 at 7:25 AM, Johan Tibell johan.tib...@gmail.com wrote: On Mon, Oct 8, 2012 at 3:28 AM, Christiaan Baaij

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread Carter Schonwald
Eugene: I think thats a bug / ticket for the haskell platform trac, rather than ghc's trac. look forward to seeing how to reproduce those problems / helping fix em! On Mon, Oct 8, 2012 at 3:08 PM, Eugene Kirpichov ekirpic...@gmail.comwrote: Johan, should I also file the bugreport remove the

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-10-08 Thread Mark Lentczner
I'm the source of the 32-bit recommendation, and the HP Mac distribution builder To summarize what I read in this thread: 1. 32-bit GHC/HP didn't work with 64-bit Cario libs 2. Some libs available via brew were 64-bit, and 32-bit ones would have to be compiled 3. There is still some

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-28 Thread Lyndon Maydwell
Carter: Not yet. I'll get round to it once I'm done with with an Agda presentation I'm working on. Until then I can't afford to break my environment. On Fri, Sep 28, 2012 at 1:56 PM, Carter Schonwald carter.schonw...@gmail.com wrote: do these problems also happen if your'e using the glut

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-28 Thread Christiaan Baaij
The GLUT-backend calls system.exit when the window is closed, because 'exitMainLoop' is only defined within freeglut, which is not by default installed on non-linux platforms. There is hence no real point in running gloss applications with the GLUT-backend from GHCi. I'll try to find a

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-27 Thread Christiaan Baaij
The behaviour seems to differ between versions of OS X. A student has OS X 10.8 installed and is observing the described behaviour: 32-bit: interpreted and compiled work correctly 64-bit: only compiled code works correctly However, I have OS X 10.6, and I'm observing the following behaviour:

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-27 Thread Lyndon Maydwell
I'm experiencing the same issues with compiled 64 bit working correctly, but interpreted causing all sorts of issues with Scotty. On Thu, Sep 27, 2012 at 3:45 PM, Christiaan Baaij christiaan.ba...@gmail.com wrote: The behaviour seems to differ between versions of OS X. A student has OS X 10.8

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-27 Thread Carter Schonwald
do these problems also happen if your'e using the glut backend? (because if its only glfw that has problems, then its something wrong in the ffi code, but if its both, that suggests there may be some sort of systematic problem?) @Lyndon, that sounds like a bug... especially since scotty seems to

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Johan Tibell
Hi, On Wed, Sep 26, 2012 at 7:44 AM, Carter Schonwald carter.schonw...@gmail.com wrote: To the best of my knowledge there is absolutely no reason to use the 32bit haskell on OS X (aside from memory usage optimization cases which likely do not matter to the *typical* user), and the community

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Erik Hesselink
On Wed, Sep 26, 2012 at 10:58 AM, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Sep 26, 2012 at 7:44 AM, Carter Schonwald carter.schonw...@gmail.com wrote: To the best of my knowledge there is absolutely no reason to use the 32bit haskell on OS X (aside from memory usage optimization

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Bob Hutchison
On 2012-09-26, at 1:44 AM, Carter Schonwald carter.schonw...@gmail.com wrote: what can we (the community ) do to address the fact that the haskell platform installer suggestions for os x are sadly completely backwards? (or am I completely wrong in my personal stance on this matter) I'd

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Johan Tibell
Adding Mark who's the release manager for the platform (and also the maintainer of the OS X builds). On Wed, Sep 26, 2012 at 11:57 AM, Erik Hesselink hessel...@gmail.com wrote: On Wed, Sep 26, 2012 at 10:58 AM, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Sep 26, 2012 at 7:44 AM, Carter

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-26 Thread Kim-Ee Yeoh
Both are excellent points, thank you. Your mention of general recursion prompts the following: in 1995, ten years after publication of Boehm-Berarducci, Launchbury and Sheard investigated transformation of programs written in general recursive form into build-foldr form, with an eye towards the

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Christiaan Baaij
Running gloss [1] programs from GHCi only works with the 32bit version of the latest Haskell Platform. The 64-bit version just shows a black window and GHCi becomes unresponsive. I use gloss to display trees and graphs in the functional programming course given at our university. The ability to

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Carter Schonwald
really? does the 64 bit code work correctly when compiled? if the compiled version works correctly, could you post a repo of some example codlets that *should work* on ghc 7.6 so i can sort out if its fixable. There were some similar problems with gtk / cairo for a while on OS X, and i was able

[Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-25 Thread Eugene Kirpichov
Hi, I installed Haskell Platform 32-bit on a fresh 64-bit mac, because the page http://www.haskell.org/platform/mac.html says: Pick the 32-bit vesion, unless you have a specific reason to use the 64-bit version. The 32-bit one is slightly faster for most programs. Then, during the installation

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-25 Thread oleg
Wouldn't you say then that Church encoding is still the more appropriate reference given that Boehm-Berarducci's algorithm is rarely used? When I need to encode pattern matching it's goodbye Church and hello Scott. Aside from your projects, where else is the B-B procedure used? First of

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-25 Thread Dan Doel
On Wed, Sep 26, 2012 at 12:41 AM, o...@okmij.org wrote: First of all, the Boehm-Berarducci encoding is inefficient only when doing an operation that is not easily representable as a fold. Quite many problems can be efficiently tackled by a fold. Indeed. Some operations are even more efficient

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-25 Thread Carter Schonwald
Hi Eugene, To the best of my knowledge there is absolutely no reason to use the 32bit haskell on OS X (aside from memory usage optimization cases which likely do not matter to the *typical* user), and the community should probably update the recommendation to reflect this. I can certainly attest

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-23 Thread Kim-Ee Yeoh
On Thu, Sep 20, 2012 at 3:15 PM,o...@okmij.org wrote: Incidentally, there is more than one way to build a predecessor of Church numerals. Kleene's solution is not the only one. Wouldn't you say then that Church encoding is still the more appropriate reference given that Boehm-Berarducci's

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-22 Thread oleg
do you have any references for the extension of lambda-encoding of data into dependently typed systems? Is there a way out of this quagmire? Or are we stuck defining actual datatypes if we want dependent types? Although not directly answering your question, the following paper Inductive

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-20 Thread oleg
Dan Doel wrote: P.S. It is actually possible to write zip function using Boehm-Berarducci encoding: http://okmij.org/ftp/Algorithms.html#zip-folds If you do, you might want to consider not using the above method, as I seem to recall it doing an undesirable amount of extra work

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-20 Thread Jay Sulzberger
On Thu, 20 Sep 2012, o...@okmij.org wrote: Dan Doel wrote: P.S. It is actually possible to write zip function using Boehm-Berarducci encoding: http://okmij.org/ftp/Algorithms.html#zip-folds If you do, you might want to consider not using the above method, as I seem to recall it

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-20 Thread Jay Sulzberger
is actually meaningful). Not only they are faster; one can _syntactically_ prove that PRED . SUCC is the identity. What is the setup that, here, gives the distinction between a syntactic proof and some other kind of proof? oo--JS. Ah, I have just read the for-any vs for-all part of http://okmij.org

Re: [Haskell-cafe] foldl vs. foldr

2012-09-19 Thread wren ng thornton
cata vs para, left folds do not appear to be strictly more powerful. Right folds can capture algorithms that left folds (apparently) can't; e.g., folds over infinite structures. I say apparently because once you add scanl/r to the discussion instead of just foldl/r, things get a lot murkier

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-19 Thread wren ng thornton
On 9/18/12 4:27 AM, o...@okmij.org wrote: There has been a recent discussion of ``Church encoding'' of lists and the comparison with Scott encoding. I'd like to point out that what is often called Church encoding is actually Boehm-Berarducci encoding. That is, often seen newtype ChurchList a

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-19 Thread Dan Doel
On Wed, Sep 19, 2012 at 8:36 PM, wren ng thornton w...@freegeek.org wrote: P.S. It is actually possible to write zip function using Boehm-Berarducci encoding: http://okmij.org/ftp/ftp/Algorithms.html#zip-folds Of course it is; I just never got around to doing it :) If you do, you

[Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread oleg
There has been a recent discussion of ``Church encoding'' of lists and the comparison with Scott encoding. I'd like to point out that what is often called Church encoding is actually Boehm-Berarducci encoding. That is, often seen newtype ChurchList a = CL { cataCL :: forall r. (a - r - r)

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Ivan Lazar Miljenovic
On 18 September 2012 18:27, o...@okmij.org wrote: There has been a recent discussion of ``Church encoding'' of lists and the comparison with Scott encoding. I'd like to point out that what is often called Church encoding is actually Boehm-Berarducci encoding. That is, often seen newtype

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Kim-Ee Yeoh
Oleg, Let me try to understand what you're saying here: (1) Church encoding was discovered and investigated in an untyped setting. I understand your tightness criterion to mean surjectivity, the absence of which means having to deal with junk. (2) Church didn't give an encoding for

[Haskell-cafe] foldl vs. foldr

2012-09-18 Thread Jan Stolarek
Hi list, I have yet another question about folds. Reading here and there I encountered statements that foldr is more important than foldl, e.g. in this post on the list: http://www.haskell.org/pipermail/haskell-cafe/2012-May/101338.html I want to know are such statements correct and, if so,

Re: [Haskell-cafe] foldl vs. foldr

2012-09-18 Thread Miguel Mitrofanov
Hi Jan! foldl always traverses the list to the end; in particular, if there is no end, it would hang forever (unless the compiler is smart enough to detect an infinite loop, in which case it can throw an error). On the other hand, if the first argument is lazy enough, foldr would stop before

Re: [Haskell-cafe] foldl vs. foldr

2012-09-18 Thread Chaddaï Fouché
18.09.2012, 16:32, Jan Stolarek jan.stola...@p.lodz.pl: Hi list, I have yet another question about folds. Reading here and there I encountered statements that foldr is more important than foldl, e.g. in this post on the list:

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Ryan Ingram
Oleg, do you have any references for the extension of lambda-encoding of data into dependently typed systems? In particular, consider Nat: nat_elim :: forall P:(Nat - *). P 0 - (forall n:Nat. P n - P (succ n)) - (n:Nat) - P n The naive lambda-encoding of 'nat' in the untyped lambda-calculus

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Dan Doel
This paper: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.26.957 Induction is Not Derivable in Second Order Dependent Type Theory, shows, well, that you can't encode naturals with a strong induction principle in said theory. At all, no matter what tricks you try. However, A Logic

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Ryan Ingram
Fascinating! But it looks like you still 'cheat' in your induction principles... ×-induction : ∀{A B} {P : A × B → Set} → ((x : A) → (y : B) → P (x , y)) → (p : A × B) → P p ×-induction {A} {B} {P} f p rewrite sym (×-η p) = f (fst p) (snd p) Can you somehow define

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Dan Doel
On Tue, Sep 18, 2012 at 11:19 PM, Ryan Ingram ryani.s...@gmail.com wrote: Fascinating! But it looks like you still 'cheat' in your induction principles... ×-induction : ∀{A B} {P : A × B → Set} → ((x : A) → (y : B) → P (x , y)) → (p : A × B) → P p ×-induction {A}

Re: [Haskell-cafe] Church vs Boehm-Berarducci encoding of Lists

2012-09-18 Thread Ryan Ingram
On Tue, Sep 18, 2012 at 8:39 PM, Dan Doel dan.d...@gmail.com wrote: On Tue, Sep 18, 2012 at 11:19 PM, Ryan Ingram ryani.s...@gmail.com wrote: Fascinating! But it looks like you still 'cheat' in your induction principles... ×-induction : ∀{A B} {P : A × B → Set} → ((x :

[Haskell-cafe] IO vs MonadIO

2012-09-12 Thread Sergey Mironov
Hi. Just a brief question. System.IO functions are defined in IO monad and have signatures like Foo - IO Bar. Would it be better to have all of them defined as (MonadIO m) = Foo - m Bar? What are the problems that would arise? Sergey ___ Haskell-Cafe

Re: [Haskell-cafe] IO vs MonadIO

2012-09-12 Thread Ivan Lazar Miljenovic
On 12 September 2012 18:24, Sergey Mironov ier...@gmail.com wrote: Hi. Just a brief question. System.IO functions are defined in IO monad and have signatures like Foo - IO Bar. Would it be better to have all of them defined as (MonadIO m) = Foo - m Bar? What are the problems that would arise?

Re: [Haskell-cafe] IO vs MonadIO

2012-09-12 Thread Ivan Lazar Miljenovic
On 12 September 2012 19:55, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 12 September 2012 18:24, Sergey Mironov ier...@gmail.com wrote: Hi. Just a brief question. System.IO functions are defined in IO monad and have signatures like Foo - IO Bar. Would it be better to have all of

[Haskell-cafe] pattern matching vs if-then-else

2012-08-12 Thread Maarten Faddegon
Hi there, I am writing a toy compiler in Haskell to further my skills in functional programming. One of the functions I wrote is to determine the iteration count of a loop. I have a number of different test that I want to do and I find myself now testing some of these using pattern matching

Re: [Haskell-cafe] pattern matching vs if-then-else

2012-08-12 Thread Gregory Collins
On Sun, Aug 12, 2012 at 1:30 PM, Maarten Faddegon haskell-c...@maartenfaddegon.nl wrote: = if-- All stmts use the same lcv test_lcv == init_lcv test_lcv == update_lcv test_lcv == update_lcv' -- And the lcv is not updated in the body This

[Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Matthew
I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or whether it's better to use pattern matching. I've got two functions which take an input and return Maybe SomeType. If either returns Nothing, I also want

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Benjamin Edwards
The do notation in this instance yields a nice advantage: if you want to switch to a different monad to encapsulate failure you will meely need to swap out the type signature and your function will need no further work. On Aug 4, 2012 7:35 AM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Johan Holmquist
Also if you don't need foo and bar you can write: callFoo callBar return baz //Johan On Aug 4, 2012 8:36 AM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Alexander Solla
On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or whether it's better to use pattern matching. I've got two functions which take

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Matthew
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla alex.so...@gmail.com wrote: On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: I'm a somewhat experienced coder but I am relatively new to Haskell. I've got a question about whether a usage of do notation is idiomatic, or

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Donn Cave
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla alex.so...@gmail.com wrote: On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: ... With do notation, I can write something like this: do foo - callFoo x bar - callBar x return (baz)

  1   2   3   4   5   6   7   8   9   10   >