Re: [Haskell-cafe] Convert Either to Tree - Occurs check

2010-10-21 Thread Dan Piponi
André Batista Martins asked:  i want convert  Either to a tree.  Example:   Either ( Either  1 2 ) ( Either 3 4) Branch ( Branch (Leafl 1)  (Leafr2) ) ( Branch (Leafl 3)  (Leafr4)) ) Before writing the function to convert your data structure, why not try writing

Re: [Haskell-cafe] capture of idioms and patterns

2010-09-23 Thread Dan Piponi
On Thu, Sep 23, 2010 at 1:57 PM, Andrew Coppin andrewcop...@btinternet.com wrote: If you think that sounds silly, ask some random person (not a computer programmer, just some random human) how find the sum of a list of numbers. I can practically guarantee that most humans will reply do X, then

Re: [Haskell-cafe] Higher-order algorithms

2010-08-24 Thread Dan Piponi
Automatic differentiation can also bee seen this way. In a sense it transforms a function to compute f(x) into a function to compute f'(x), where f' is the derivative of f. -- Dan On Mon, Aug 23, 2010 at 6:03 AM, Eugene Kirpichov ekirpic...@gmail.com wrote: Most of the well-known algorithms are

Re: [Haskell-cafe] Suggestions For An Intro To Monads Talk.

2010-08-03 Thread Dan Piponi
On Tue, Aug 3, 2010 at 2:51 PM, aditya siram aditya.si...@gmail.com wrote: I am doing an Intro To Monads talk in September [1]. ...what would you stay away from. Some things to stay away from: http://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/

Re: [Haskell-cafe] Nomic game in Haskell

2010-04-15 Thread Dan Piponi
Dupont asked: do you know Nomic? It's a fabulous and strange game where you have the right to change the rules in the middle of the game! I know nomic, but as has been pointed out, it's too wide-ranging to be captured in Haskell. So how about a game played in the Haskell type system where

[Haskell-cafe] Re: Nomic game in Haskell

2010-04-15 Thread Dan Piponi
On Thu, Apr 15, 2010 at 4:58 PM, Ashley Yakeley ash...@semantic.org wrote: type Board a b c d e f g h i =  Either (Three a b c)  (Either (Three d e f)  (Either (Three g h i)  (Either (Three a d g)  (Either (Three b e h)  (Either (Three c f i)  (Either (Three a e i)  (Either (Three c e g)

[Haskell-cafe] Suitable structure to represents lots of similar lists

2010-04-07 Thread Dan Piponi
I have a situation where I have a bunch of lists and I'll frequently be making new lists from the old ones by applying map and filter. The map will be applying a function that's effectively the identity on most elements of the list, and filter will be using a function that usually gives True. This

Re: [Haskell-cafe] Books for advanced Haskell

2010-03-06 Thread Dan Piponi
Günther, A shining example are Dan Piponis blog posts. When you get stuck, post a comment saying where so that I can learn what people find difficult. On the other hand, I understand how intangible not-understanding can be, so it can be hard to point to where the problem is. -- Dan

Re: [Haskell-cafe] lawless instances of Functor

2010-01-04 Thread Dan Piponi
On Mon, Jan 4, 2010 at 3:01 PM, Derek Elkins derek.a.elk...@gmail.com wrote: Ignoring bottoms the free theorem for fmap can be written: If h . p = q . g then fmap h . fmap p = fmap q . fmap g When I play with http://haskell.as9x.info/ft.html I get examples that look more like: If fmap' has

Re: [Haskell-cafe] lawless instances of Functor

2010-01-04 Thread Dan Piponi
On Mon, Jan 4, 2010 at 3:26 PM, Derek Elkins derek.a.elk...@gmail.com wrote: Yes, I have the same problem...Basically, I'm pretty sure the construction of that free theorem doesn't rely on any of the actual details... For a long time I've thought such a higher order free theorem must exist,

Re: [Haskell-cafe] lawless instances of Functor

2010-01-04 Thread Dan Piponi
On Mon, Jan 4, 2010 at 4:15 PM, Paul Brauner paul.brau...@loria.fr wrote: I wonder why this isn't some classic category theory result (maybe it is ?) It doesn't hold in category theory in general. Haskell (or at least a certain subset) is special - many things that just *look* category

[Haskell-cafe] Missing symbol when trying to use OpenCLRaw

2009-12-23 Thread Dan Piponi
Can anyone tell me what command line options I need to build a simple example using OpenCLRaw on MacOSX (ghc 6.10.4)? Using -framework OpenCL reduces the missing symbols down to just _clGetProgramInfo but I can't see how to eliminate that last one. Has anyone else played with OpenCLRaw? -- Dan

Re: [Haskell-cafe] Why?

2009-12-11 Thread Dan Piponi
On Fri, Dec 11, 2009 at 11:46 AM, Andrew Coppin andrewcop...@btinternet.com wrote: On the other hand, turn up the optimisation settings on a C compiler high enough and the program breaks. Not if you write actual C as specified by the standard. In fact, these days gcc internally converts your

Re: [Haskell-cafe] Could someone teach me why we use Data.Monoid?

2009-11-15 Thread Dan Piponi
2009/11/14 Daniel Schüssler anotheraddr...@gmx.de:  - Product (a,b) and co-product (Either) of monoids the coproduct of monoids is actually a bit tricky. Funny, I was just thinking about that. I was pondering the article at LTU on Lawvere theories: http://lambda-the-ultimate.org/node/3235

Re: [Haskell-cafe] What does the `forall` mean ?

2009-11-11 Thread Dan Piponi
On Wed, Nov 11, 2009 at 4:24 PM, zaxis z_a...@163.com wrote: data Branch tok st a     = forall b. Branch (PermParser tok st (b - a)) (GenParser tok st b) I have hoogled the `forall` but i cannot find any appropriate answer! That's an example of an existential type. What that line is saying is

Re: [Haskell-cafe] is proof by testing possible?

2009-10-12 Thread Dan Piponi
On Mon, Oct 12, 2009 at 10:42 AM, muad muad.dib.sp...@gmail.com wrote: Is it possible to prove correctness of a functions by testing it? I think the tests would have to be constructed by inspecting the shape of the function definition. not True==False not False==True Done. Tested :-) Less

Re: [Haskell-cafe] is proof by testing possible?

2009-10-12 Thread Dan Piponi
Joe, On Mon, Oct 12, 2009 at 11:03 AM, Joe Fredette jfred...@gmail.com wrote: I completely forgot about free theorems! Do you have some links to resources -- I tried learning about them a while ago, but couldn't get a grasp on them... Thanks. There is Wadler's paper but I do find it tricky:

Re: [Haskell-cafe] is proof by testing possible?

2009-10-12 Thread Dan Piponi
I'm making the same mistake repeatedly. In both my mails there are places where I said (a,b) or (b,a) when I meant (a,a). -- Dan On Mon, Oct 12, 2009 at 11:09 AM, Dan Piponi dpip...@gmail.com wrote: Joe, On Mon, Oct 12, 2009 at 11:03 AM, Joe Fredette jfred...@gmail.com wrote: I completely

Re: [Haskell-cafe] is proof by testing possible?

2009-10-12 Thread Dan Piponi
On Mon, Oct 12, 2009 at 11:31 AM, Neil Brown nc...@kent.ac.uk wrote: swap = undefined Terminates and does not swap its arguments :-) What do free theorems say about this, exactly -- do they just implicitly exclude this possibility? I'm terrible at reasoning about functions with bottoms (ie.

Re: [Haskell-cafe] What *is* a DSL?

2009-10-07 Thread Dan Piponi
2009/10/7 Joe Fredette jfred...@gmail.com: Let me add to this, as I've used the term DSL without (*gasp*) fully understanding it before. In addition to What is a DSL, I'd like to ask: How is a DSL different from an API? I don't think there is a sharp divide here. A nice example was given by

Re: Fwd: [Haskell-cafe] Haskell for Physicists

2009-10-03 Thread Dan Piponi
Yesterday I was at a talk by Pat Hanrahan on embedded DSLs and GPUs at the nvidia GPU conference: http://www.nvidia.com/object/gpu_technology_conference.html Pat argued that the only way forward to achieve usable computing power for physics on heterogeneous computers (eg. multicore+GPU) is

Re: [Haskell-cafe] Help starting a Haskell blog

2009-08-22 Thread Dan Piponi
On Sat, Aug 22, 2009 at 3:35 AM, Peter Verswyvelenbugf...@gmail.com wrote: Could you share your experiences with me about starting a blog? BTW: I'm on Windows. I've found it hard work to post a mixture of English, Mathematics and Haskell. Neither of the most popular blogging web sites are very

Re: [Haskell-cafe] lazy data structure for best-first search

2009-07-07 Thread Dan Piponi
On Wed, Jun 24, 2009 at 6:53 PM, Martin Hofmannmartin.hofm...@uni-bamberg.de wrote: I am looking for a good (preferably lazy) way to implement some kind of best-first search. So in fact, after one expansion, I need to fold over my complete search space, maybe updating other nodes and

Re: [Haskell-cafe] What is an expected type ...

2009-06-28 Thread Dan Piponi
I really dislike this error message, and I think the terms are ambiguous. I think the words 'expected' and 'inferred' apply equally well to the term, and the context in which it has been found. Both of the incompatible types were 'inferred', and 'unexpected' is a property of the combination, not a

Re: [Haskell-cafe] Confusion on the third monad law when using lambda abstractions

2009-06-17 Thread Dan Piponi
On Wed, Jun 17, 2009 at 6:08 PM, Jon Straitjstr...@moonloop.net wrote: ...but if there were another monad defined like, data MadMaybe a = Nothing | Perhaps | Just a MadMaybe violates the second law. It's quite unlike a monad. -- Dan ___ Haskell-Cafe

Re: [Haskell-cafe] Visualizing Typed Functions

2009-05-07 Thread Dan Piponi
Duane, Your fourth diagram is hard to distinguish from that for a function that takes three inputs and returns one. And what would be the diagram for a function that maps one binary function to another? I spend a bit of my time at work playing with typed visual dataflow type tools. I've never

Re: [Haskell-cafe] Re: A bit of a shock - Memoizing functions

2009-03-27 Thread Dan Piponi
2009/3/27 Kirk Martinez kirk.marti...@gmail.com: I wonder: does the converse exist? Haskell data constructors which are really functions? How and for what might one use those? You might enjoy reading about the use of tries for memoisation. Conal Elliott explains nicely how you can an

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-25 Thread Dan Piponi
On Wed, Mar 25, 2009 at 12:44 PM, Thomas Hartman tphya...@gmail.com wrote: Are you saying there's a problem with this implementation? It's the Yes, there is actually a problem with this implementation. However, there is something to be said for code that just looks like a duck and quacks

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Dan Piponi
Miguel Mitrofanov wrote: takeList = evalState . mapM (State . splitAt) However, ironically, I stopped using them for pretty much the same reason that Manlio is saying. Are you saying there's a problem with this implementation? It's the only one I could just read immediately. The trick is to

Re: categories and monoids (was: Re: [Haskell-cafe] Design Patterns by Gamma or equivalent)

2009-03-17 Thread Dan Piponi
On Tue, Mar 17, 2009 at 5:06 AM, Wolfgang Jeltsch g9ks1...@acme.softbase.org wrote: What is a “generalized monoid”? According to the grammatical construction (adjective plus noun), it should be a special kind of monoid There's no such implication in English. The standard example used by

Re: [Haskell-cafe] Purely funcional LU decomposition

2009-02-04 Thread Dan Piponi
2009/2/3 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com: After a discussion on whether is possible to compile hmatrix in Windows, I decided to go crazy and do a LU decomposition entirely in Haskell... import Data.Array.IArray ... e_an i j=a!(i,j)-(lik

Re: [Haskell-cafe] Monad explanation

2009-02-04 Thread Dan Piponi
On Wed, Feb 4, 2009 at 12:16 PM, Tymur Porkuian shooshpanch...@gmail.com wrote: For me, the key to understanding monads was that monad is a value that know how to apply functions to itself. Or, more correctly, a container that knows how to apply functions to whatever is inside it. You've just

Re: [Haskell-cafe] Purely funcional LU decomposition

2009-02-04 Thread Dan Piponi
On Wed, Feb 4, 2009 at 12:57 PM, Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com wrote: Those different representations are derived from my (very) low Haskell handicap! :-D BTW That wasn't intended in any way as a criticism. I think it's interesting to look at real matrix code

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Dan Piponi
On Mon, Feb 2, 2009 at 8:09 AM, Gregg Reynolds d...@mobileink.com wrote: Yes, that's my hypothesis: type constructors take us outside of set theory (ZF set theory, at least). I just can't prove it. It's too big for Set Theory if you insist on representing functions in type theory as

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Dan Piponi
2009/2/2 Luke Palmer lrpal...@gmail.com: But Nat ~ Bool is computably uncountable, meaning there is no injective (surjective?) function Nat ~ (Nat ~ Bool), by the diagonal argument above. Given that the Haskell functions Nat - Bool are computably uncountable, you'd expect that for any

Re: [Haskell-cafe] type metaphysics

2009-02-02 Thread Dan Piponi
On Mon, Feb 2, 2009 at 3:18 PM, Reid Barton rwbar...@math.harvard.edu wrote: toSame f = (const True, head [ ( k) | k - [1..], f (const True) == f ( k) ]) Nice! I like it because at first look it seems like there's no reason for this to terminate, but as you correctly argue, it always does. --

Re: [Haskell-cafe] How to define an operation in terms of itself (but of different type)?

2009-01-23 Thread Dan Piponi
2009/1/23 Olex P hoknam...@gmail.com: class Vector v where (^+^) :: v - v - v data Vector3 = V3 !Double !Double !Double instance Vector Vector3 where (V3 x1 y1 z1) ^+^ (V3 x2 y2 z2) = V3 (x1 + x2) (y1 + y2) (z1 + z2) class Matrix m where (^+^) :: m - m - m data

Re: [Haskell-cafe] Why monoids will abide...

2009-01-22 Thread Dan Piponi
On Wed, Jan 21, 2009 at 11:12 PM, Eugene Kirpichov ekirpic...@gmail.com wrote: To my mind, in the map-reduce case you generally need a commutative monoid. Or, you need an extra infrastructure that mappend's only results from adjacent machines, or something like that. This is a good paper on

Re: [Haskell-cafe] Why monoids will abide...

2009-01-21 Thread Dan Piponi
Another important application of monoids is in parallelisation. In map-reduce you want to split the reduce part over multiple processors and combine the results back together again. Associativity ensures that when you combine the pieces together you get the same result as if you did the whole

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Dan Piponi
On Mon, Jan 19, 2009 at 11:33 AM, Andrew Coppin andrewcop...@btinternet.com wrote: My only problem with it is that it's called Bool, while every other programming language on Earth calls it Boolean. (Or at least, the languages that *have* a name for it...) Python: bool ocaml: bool C++: bool

Re: [Haskell-cafe] Re: Improved documentation for Bool

2009-01-19 Thread Dan Piponi
On Mon, Jan 19, 2009 at 6:25 PM, David Menendez d...@zednenem.com wrote: Are there any instances of Boolean that aren't isomorphic to Bool? a-Bool for any a. I think. Though I think it should be called GeorgeBoolean otherwise we might confuse it for something his father might have invented. --

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-17 Thread Dan Piponi
On Sat, Jan 17, 2009 at 1:47 AM, david48 dav.vire+hask...@gmail.com wrote: why would I need to write a running count this way instead of, for example, a non monadic fold, which would probably result in clearer and faster code? Maybe my post here will answer some questions like that:

Re: [Haskell-cafe] Documentation [Comments from OCaml Hacker Brian Hurt]

2009-01-16 Thread Dan Piponi
On Fri, Jan 16, 2009 at 12:09 PM, Paul Moore p.f.mo...@gmail.com wrote: How about associativity means that how you pair up the operations does not affect the result? I think a better way is this: If you have an element of a monoid, a, there are two ways to combine it with another element, on

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Dan Piponi
On Thu, Jan 15, 2009 at 7:34 AM, John Goerzen jgoer...@complete.org quoted: I'd be inclined to call it something like Appendable. But I don't know what Appendable means. Maybe it means class Appendable a where append :: a x - x - a x ie. a container x's lets you can add an x to the end

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Dan Piponi
On Thu, Jan 15, 2009 at 12:11 PM, John Goerzen jgoer...@complete.org wrote: On Thu, Jan 15, 2009 at 07:46:02PM +, Andrew Coppin wrote: John Goerzen wrote: can we at least write some documentation that doesn't require a PhD to comprehend? Several people have suggested this, and I think it

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Dan Piponi
On Thu, Jan 15, 2009 at 1:29 PM, Andrew Coppin andrewcop...@btinternet.com wrote: But you really *should not* need to do an undergraduate course in mathematical theory just to work out how to concat two lists. That's absurd. Some kind of balance needs to be found. Balance is good, but it's

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Dan Piponi
On Thu, Jan 15, 2009 at 2:24 PM, Miguel Mitrofanov miguelim...@yandex.ru wrote: If, however, you category is a category of endofunctors of some category D (that is, functors D - D), and T is composition, then our monoids become monads on D: I is an identity functor, first morphism is return,

Re: [Haskell-cafe] Real World Haskell: confusion

2009-01-13 Thread Dan Piponi
2009/1/13 Peter Verswyvelen bugf...@gmail.com: On page 102: partial function application is named currying I thought currying or to curry means converting f :: (a,b) -c Confusion over these terms is commonplace. See, for example, the discussion here: http://lambda-the-ultimate.org/node/2266 --

Re: Fwd: [Haskell-cafe] Haskell as a religion

2008-12-18 Thread Dan Piponi
On Thu, Dec 18, 2008 at 4:15 PM, Henning Thielemann schlepp...@henning-thielemann.de wrote: In C/C++ referential transparent functions code can be declared by appending a 'const' to the prototype, right? For one thing, some fields in a const C++ object can be explicitly set mutable. mutable is

Re: [Haskell-cafe] Origins of '$'

2008-12-08 Thread Dan Piponi
On Sun, Dec 7, 2008 at 2:05 AM, Hans Aberg [EMAIL PROTECTED] wrote: As for the operator itself, it appears in Alonzo Church, The Calculi of Lambda-Conversion, where it is written as exponentiation, like x^f That's reminiscent of the notation in Lambek and Scott where (roughly speaking) the

Re: [Haskell-cafe] Origins of '$'

2008-12-08 Thread Dan Piponi
2008/12/8 Joachim Breitner [EMAIL PROTECTED]: So A^(B+C) = A^B × A^C ? That's part of the basis for Hinze's paper on memoization: http://www.informatik.uni-bonn.de/~ralf/publications/WGP00b.ps.gz It's always nice to see that I havn't learned the elementary power calculation rules for nothing

Re: [Haskell-cafe] Gluing pipes

2008-12-04 Thread Dan Piponi
On Wed, Dec 3, 2008 at 10:17 AM, Matt Hellige [EMAIL PROTECTED] wrote: From time to time, I've wanted to have a more pleasant way of writing point-free compositions of curried functions. I'd like to be able to write something like: \ x y - f (g x) (h y) This particular composition of f with

Re: [Haskell-cafe] Gluing pipes

2008-12-04 Thread Dan Piponi
On Thu, Dec 4, 2008 at 10:21 AM, Matt Hellige [EMAIL PROTECTED] wrote: \ f x y z - f x z y == id ~ flip It's not clear to me whether your operad class can express this (or whether operads in general can express this) There exists an operad that can (at the cost of even more notation), but

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-13 Thread Dan Piponi
Real time audio applications are top of my list of crazy projects I would work on if I had a month spare. I think it might work out nicely. My approach wouldn't be to talk directly to audio hardware from Haskell but instead use a framework like Lava to generate low level code from an embedded DSL.

Re: [Haskell-cafe] What *not* to use Haskell for

2008-11-13 Thread Dan Piponi
On Thu, Nov 13, 2008 at 11:08 AM, Andrew Coppin [EMAIL PROTECTED] wrote: In other words, Haskell is an excellent language for designing special-purpose compilers and interpretters for custom languages. ;-) If I knew a damned thing about IA32 assembly and dynamic linkage, I'd be tempted to try

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-04 Thread Dan Piponi
On Tue, Nov 4, 2008 at 9:26 AM, Achim Schneider [EMAIL PROTECTED] wrote: Martijn van Steenbergen [EMAIL PROTECTED] wrote: For anything remotely connected to parsing, always use parsec. I'd not be surprised if the beast is touring complete in itself... Actually, this can count against you.

[Haskell-cafe] The Haskell type inference feature I'd really like to see

2008-10-24 Thread Dan Piponi
I'd like to be able to write something like map zipWith ([1,2,3] = printMyInferredType) and have the compiler treat 'printMyInferredType' as undefined, but also produce the side effect of printing out its inferred type. What's the easiest way to simulate this with what we have now? -- Dan

Re: [Haskell-cafe] Crash!

2008-10-23 Thread Dan Piponi
On Thu, Oct 23, 2008 at 1:26 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Does anybody know of any tools for definitely pinning down stuff like this? Surely C programmers have their code crash several hundred times a day due to bugs like this... Curiously, the tool I often use with C/C++ to

Re: [Haskell-cafe] (A little humour)

2008-10-01 Thread Dan Piponi
On Wed, Oct 1, 2008 at 2:59 AM, Manlio Perillo [EMAIL PROTECTED] wrote: Miguel Mitrofanov ha scritto: By the way, is it technically possible (and feasible), in Haskell, to define a space operator? In a way it's what is described in this paper: http://www.cs.nott.ac.uk/~ctm/IdiomLite.pdf In

Re: [Haskell-cafe] (A little humour)

2008-10-01 Thread Dan Piponi
On Wed, Oct 1, 2008 at 2:45 PM, Dan Piponi [EMAIL PROTECTED] wrote: In the proposed notation, within [[]]'s there is an implied * for every space. Come to think of it, surely that's why they're called *applicative* functors. In Haskell, a space between identifiers corresponds implicitly

Re: [Haskell-cafe] Line noise

2008-09-21 Thread Dan Piponi
On Sun, Sep 21, 2008 at 7:49 PM, wren ng thornton [EMAIL PROTECTED] wrote: We inherited our use of spaces for function application from Lisp and friends, so foo bar baz looks perfectly natural to functionalists. But to those used to seeing foo(bar, baz) the meaning attached to the spaces is

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Dan Piponi
On Thu, Sep 18, 2008 at 11:59 AM, Andrew Coppin [EMAIL PROTECTED] wrote: foo :: Int - Maybe Int foo x = do 4 - return x return (2*x) Now, if only I could find a use for all this that borders on useful...! ;-) It seems a lot less weird when you write something like: [x | (x,0) - map

Re: [Haskell-cafe] Float instance of 'read'

2008-09-16 Thread Dan Piponi
Mauricio asked: Do you think 'read' (actually, 'readsPrec'?) could be made to also read the international convention (ie., read 1,5 would also work besides read 1.5)? What would you hope the value of read (1,2,3)::(Float,Float) would be? -- Dan

Re: [Haskell-cafe] Best book/tutorial on category theory and its applications

2008-07-28 Thread Dan Piponi
fero asked: Hi, I would like to buy some booke on category theory and its applications. Can you recommend me the best? I got a lot out of Basic Category Theory for Computer Scientists by Benjamin C. Pierce. Short and with examples biased towards CS. No monads but it covers the essentials with

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-30 Thread Dan Piponi
On Thu, May 29, 2008 at 8:58 PM, Jonathan Cast [EMAIL PROTECTED] wrote: It's not French 'tis so! Two dictionaries I've now checked say it entered English from Hebrew via French 'cabale'. But that has to be the last I say on this as it's now well off topic. -- Dan

Re: [Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-29 Thread Dan Piponi
On Wed, May 28, 2008 at 6:38 PM, Richard A. O'Keefe [EMAIL PROTECTED] wrote: I've always pronounced it k'BAHL, but was surprised to find that the OED only countenances a short second syllable: The reason I originally asked is that American, British and other dialects of English handle French

[Haskell-cafe] So how do people pronounce 'cabal' around here?

2008-05-27 Thread Dan Piponi
In particular, which syllable gets the stress, and what are the lengths of the two vowels? Couldn't find anything in the FAQ (http://www.haskell.org/haskellwiki/Cabal/FAQ). -- Dan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] one-way monads

2008-05-21 Thread Dan Piponi
On Wed, May 21, 2008 at 4:08 PM, Lennart Augustsson [EMAIL PROTECTED] wrote: I certainly don't use 50% IO monads. I regard any use of the IO monad except at the top level as a failure. :) Real Haskell Programmers Only Use Top Level IO! (But then again, real programmers wouldn't use Haskell:

Re: [Haskell-cafe] one-way monads

2008-05-20 Thread Dan Piponi
On Mon, May 19, 2008 at 10:54 PM, Zsolt SZALAI [EMAIL PROTECTED] wrote: Now, i'm getting familiar with monads, but there is a little discredit about one-way monads. If someone claims that monads are one-way they are probably referring to the fact that it is impossible (without cheating!) to

Re: [Haskell-cafe] Short circuiting and the Maybe monad

2008-05-16 Thread Dan Piponi
On Fri, May 16, 2008 at 12:03 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Since a tree is a kind of container, yes, it should be a monad. [I'm still not really sure whether it's useful.] Not so much containers in general, but 'flattenable' containers. You can flatten a list of lists to a list

Re: [Haskell-cafe] Short circuiting and the Maybe monad

2008-05-14 Thread Dan Piponi
On Wed, May 14, 2008 at 12:03 PM, Andrew Coppin [EMAIL PROTECTED] wrote: It is well-known that trees with substitution form a monad. Now that's funny. Compare with the first line of this paper: http://citeseer.ist.psu.edu/510658.html Anyway, I worked through an elementary example of this with

Re: [Haskell-cafe] Copy on read

2008-05-13 Thread Dan Piponi
On Sat, May 10, 2008 at 7:20 AM, Neil Mitchell [EMAIL PROTECTED] wrote: Jurriaan Hage and Stefan Holdermans. Heap recycling for lazy languages. In John Hatcliff, Robert Glück, and Oege de Moor, editors, _Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Dan Piponi
Andrew asked, ...so it's a kind of choice operator? Run all actions until you get to one that succeeds and return the result from that? The eternal bit of trickiness for Haskell is that type classes group often together things that people don't immediately see as similar - monads probably

Re: [Haskell-cafe] MonadPlus

2008-05-09 Thread Dan Piponi
Miguel said: Well, that's the whole point of mathematics, isn't it? Abstraction is common to mathematics and computing. But in computing the abstraction often follows lines that seem obvious. For example a GUI library might have a Widget class and people can immediately identify various regions

Re: [Haskell-cafe] Re: Function Precedence

2008-04-02 Thread Dan Piponi
On Tue, Apr 1, 2008 at 2:07 PM, PR Stanley [EMAIL PROTECTED] wrote: All you'd have to do is to give the inner most function the highest precdence What's the innermost function in f g x here? test :: (a - b - c) - a - b - c test f g x = f g x -- Dan

Re: [Haskell-cafe] Type system

2008-03-14 Thread Dan Piponi
On Fri, Mar 14, 2008 at 11:50 AM, Andrew Coppin [EMAIL PROTECTED] wrote: Haskell has an expressive and powerful type system - which I love. It also has a seemingly endless list of weird and obscure type system extensions...And yet, none of this happens in any other programming language I've

Re: [Haskell-cafe] [GSoC] A data parallel physics engine

2008-03-12 Thread Dan Piponi
2008/3/12 Jed Brown [EMAIL PROTECTED]: It would be a shame to ...miss the very important point that a matrix is nothing more than a linear transformation between finite dimensional spaces. I rate this obvious seeming fact as one of the most important things I've learnt about numerical

Re: [Haskell-cafe] [GSoC] A data parallel physics engine

2008-03-12 Thread Dan Piponi
On Wed, Mar 12, 2008 at 2:33 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Hanging around here, you really feel like you're at the cutting edge of... something... heh. Another approach isn't to target a CUDA back end for Haskell but to write an array library that builds computations that can

Re: [Haskell-cafe] IO () and IO [()]

2008-03-10 Thread Dan Piponi
On Mon, Mar 10, 2008 at 3:11 PM, Paulo J. Matos [EMAIL PROTECTED] wrote: I would like to know if in fact there's any difference in practice between (), [()], i.e. if in practice the difference matters. The type [()] is very similar to the type Integer and it's quite different from () because

Re: [Haskell-cafe] Functional programmer's intuition for adjunctions?

2008-03-04 Thread Dan Piponi
Edsko asked: Is there an intuition that can be used to explain adjunctions to functional programmers, even if the match isn't necessary 100% perfect (like natural transformations and polymorphic functions?). I think there's a catch because many interesting examples of adjunctions involve

Re: [Haskell-cafe] A question about monad laws

2008-02-11 Thread Dan Piponi
IOn Feb 11, 2008 9:46 AM, Miguel Mitrofanov [EMAIL PROTECTED] wrote: It's well known that ListT m monad violates this law in general (though it satisfies it for some particular monads m). For example, I went through this example in quite a bit of detail a while ago and wrote it up here:

Re: [Haskell-cafe] #haskell works

2007-12-14 Thread Dan Piponi
On Dec 14, 2007 12:12 PM, Andrew Coppin [EMAIL PROTECTED] wrote: Today, with a few import statements and compiler switches, the exact same code takes 0.05 seconds. Tomorrow, who knows? Maybe I'm being overly optimistic, but... ;-) There have been some great improvements in array handling

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Dan Piponi
On Dec 10, 2007 4:51 AM, Daniel Fischer [EMAIL PROTECTED] wrote: Am Montag, 10. Dezember 2007 10:36 schrieb Ketil Malde: Daniel Fischer [EMAIL PROTECTED] writes: Various other people write: ... lots of talk about monads and IO ... When someone comes to me and says I have this Python

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-10 Thread Dan Piponi
On Dec 10, 2007 11:00 AM, Henning Thielemann [EMAIL PROTECTED] wrote: Does Haskell need quickdirty hackers? The question isn't Does Haskell need quickdirty hackers? It's would we get better software (using your favourite metric) if we put Haskell into the hands of quick and dirty hackers?. I

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Dan Piponi
On Dec 3, 2007 10:05 PM, David Benbennick [EMAIL PROTECTED] wrote: Could you please post your code here when you're done? I'd be interested to see the final result. This is just experimental code I'm playing with in order to implement exact real arithmetic, so there'll never be a final result

Re: [Haskell-cafe] Looking for largest power of 2 = Integer

2007-12-04 Thread Dan Piponi
There's a bit of work required to make this code good enough for general consumption, and I don't know much about Haskell internals. (1) What is the official way to find the size of a word? A quick look at 6.8.1's base/GHC/Num.lhs reveals that it uses a #defined symbol. (2) Is it safe to assume

Re: [Haskell-cafe] do

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 1:09 PM, Denis Bueno [EMAIL PROTECTED] wrote: I don't think I can conclude that there are *no* reasons to teach the do-notation first. I just think that it is more instructive to teach it later. It's standard in mathematics teaching, when introducing a mathematical structure

Re: [Haskell-cafe] Re: do

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 3:54 PM, Ben Franksen [EMAIL PROTECTED] wrote: I don't buy this. As has been noted by others before, IO is a very special case, in that it can't be defined in Haskell itself, and there is no evaluation function runIO :: IO a - a. I'm not sure what a function of type m a - a has

[Haskell-cafe] Looking for smallest power of 2 = Integer

2007-12-03 Thread Dan Piponi
Is there anything in any of the interfaces to Integer that will allow me to quickly find the highest bit set in an Integer? If not, does anyone have any recommendations for how to do it efficiently. There are some obvious things that come to mind but which might involve quite a bit of useless

Re: [Haskell-cafe] IO is a bad example for Monads [was: do]

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 6:36 PM, Ben Franksen [EMAIL PROTECTED] wrote: then the special features of IO will remain associated with monads in general, leading to a whole jumble of completely wrong ideas about them. As I only learnt about monads a couple of years ago, the process is still fresh in my

Re: [Haskell-cafe] Looking for smallest power of 2 = Integer

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 9:10 PM, Don Stewart [EMAIL PROTECTED] wrote: Is there anything in any of the interfaces to Integer that will allow me to quickly find the highest bit set in an Integer? Well, you could use testBit, which is pretty efficient, But testBit tests only one bit at a time. To prove

Re: [Haskell-cafe] Looking for smallest power of 2 = Integer

2007-12-03 Thread Dan Piponi
On Dec 3, 2007 9:32 PM, Sterling Clover [EMAIL PROTECTED] wrote: if all else fails, be determined by unpacking it into the primitives, which are (# Int#, ByteArr# #) with the Int# as the number of limbs of the integer, as well as its sign. That's the answer I'm looking for, thanks. -- Dan

Re: [Haskell-cafe] Re: Hit a wall with the type system

2007-11-29 Thread Dan Piponi
On Nov 28, 2007 9:20 PM, Chris Smith [EMAIL PROTECTED] wrote: I intend to naively treat each function as being from the reals to the reals, and then take advantage of the fact (which is proven by the type system in the code I posted) that when the derivative is evaluated at integer inputs for

Re: [Haskell-cafe] Re: Re: Hit a wall with the type system

2007-11-29 Thread Dan Piponi
Chris, So I want the parameter to be more restricted. No one is going to write a function that *only* works on AD types. But exporting AD doesn't force people to write functions that work on AD types, people can write whatever functions they like. They're only constrained if they want to pass

Re: [Haskell-cafe] Re: Re: Re: Hit a wall with the type system

2007-11-29 Thread Dan Piponi
Chris, I could change my implementation; I could use Jerzy's implementation...launch Mathematica... But all of these could be implemented by introducing a different type constructor called AD for each one. You could switch the implementation of AD on the user and they wouldn't have to change a

Re: [Haskell-cafe] Re: Weird ghci behaviour?

2007-11-13 Thread Dan Piponi
On Nov 13, 2007 3:00 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote: Dan, can you suggest any words we could add to the documentation that would have prevented you stumbling? I guess the thing that would have helped best would have been an error message like 'x' not in scope,

Re: [Haskell-cafe] let vs. where

2007-11-13 Thread Dan Piponi
On Nov 13, 2007 1:24 PM, Ryan Ingram [EMAIL PROTECTED] wrote: I tend to prefer where, but I think that guards function declarations are more readable than giant if-thens and case constructs. Up until yesterday I had presumed that guards only applied to functions. But I was poking about in the

Re: [Haskell-cafe] Weird ghci behaviour?

2007-11-12 Thread Dan Piponi
... linking ... done. Ok, modules loaded: Main. Prelude Main main 1 Prelude Main x interactive:1:0: Not in scope: `x' Prelude Main Leaving GHCi. --- On Jul 23, 2007 10:46 AM, Dan Piponi [EMAIL PROTECTED] wrote: Ian said: Can you please give

Re: [Haskell-cafe] Re: Weird ghci behaviour?

2007-11-12 Thread Dan Piponi
On Nov 12, 2007 1:59 PM, Henning Thielemann [EMAIL PROTECTED] wrote: See http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html I guess the key sentence is: For technical reasons, GHCi can only support the *-form for modules which are interpreted, so compiled

Re: [Haskell-cafe] Somewhat random history question - chicken and egg

2007-11-11 Thread Dan Piponi
This isn't a question specific to ghc. In general, the process of bootstrapping compilers and porting them to new platforms can be described by T-diagrams. When I did a web search on T-diagrams the first hit I found,

  1   2   3   >