Re: Who is afraid of arrows, was Re: [Haskell-cafe] ANNOUNCE: Haskell XML Toolbox Version 9.0.0

2010-10-12 Thread Gene A
> > On Tue, Oct 12, 2010 at 8:56 AM, Uwe Schmidt wrote: > >> No, but there is no point in using a formalism that adds complexity > >> without adding functionality. Arrows are more awkward to use than > >> monads because they were intentionally designed to be less powerful than > >> monads in orde

Re: [Haskell-cafe] Re: Re-order type

2010-10-09 Thread Gene A
2010/10/9 André Batista Martins Said: > > Might have not been clear, but i will try illustrate . > > f:: a-> b -> c -> (b,(c,a)) > f1 :: c -> a -> d > - > > I think I would attack this with glue consisting of: comb f f1 a b c = arr (\(a,b,c) -> f a b c) >>> arr (\

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-08 Thread Gene A
On Tue, Jun 8, 2010 at 8:08 AM, Don Stewart wrote: > > (... There have been a few cases of major API / rewrites to famous old > packages causing problems, including: > >* QuickCheck 1 vs 2 >* parsec 2 vs 3 >* OpenGL > ...) > > (... * No additional breakages are introduced. ...) >

[Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Gene A
The problem I see is that in both: Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and ghci 6.10.4, they both exhibit a {I think} strange behaviour, in regards to the shorthand way of calling out a list of enumerable values. I will explain the problem th

Re: [Haskell-cafe] a regressive view of support for imperative programming in Haskell

2007-08-08 Thread Gene A
On 8/8/07, Philippa Cowderoy <[EMAIL PROTECTED]> wrote: > > On Wed, 8 Aug 2007, peterv wrote: > {... > An editor that can be configured to display various inferred details, > annotations and desugarings in the middle of the source would be useful > for all kinds of purposes, and certainly not just

Re: [Haskell-cafe] Implementing Mathematica

2007-06-12 Thread Gene A
On 6/2/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: (... and showing an example of a simple-minded simplifier and symbolic differentiator. The unification was presented as a powerful pattern-matcher, being able to instanciate logic variables, and test the coherence within patterns sharing t

Re: [Haskell-cafe] Re: Map list of functions over a single argument

2007-02-21 Thread Gene A
On 2/21/07, Jules Bean <[EMAIL PROTECTED]> wrote: Gene A wrote: > Prelude> let revApply a f = f a > Prelude> let rMap a fs = map (revApply a) fs > Prelude> rMap 2 [(*4),(^2),(+12),(**0.5)] > [8.0,4.0,14.0,1.4142135623730951] > Note that revApply here is precis

Re: [Haskell-cafe] Re: Map list of functions over a single argument

2007-02-21 Thread Gene A
On 2/21/07, Henning Thielemann <[EMAIL PROTECTED]> wrote: On Tue, 20 Feb 2007 [EMAIL PROTECTED] wrote: > Paul Moore wrote: > > I'm after a function, sort of equivalent to map, but rather than > > mapping a function over a list of arguments, I want to map a list of > > functions over the same a

Re: [Haskell-cafe] Newbie: generating a truth table

2007-02-20 Thread Gene A
On 2/10/07, Peter Berry <[EMAIL PROTECTED]> wrote: Sigh, I seem to have done a reply to sender. Reposting to the list. On 06/02/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to create a Haskell function that generates a truth table, for > all Boolean values, say, us

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-15 Thread Gene A
On 2/15/07, Gene A <[EMAIL PROTECTED]> wrote: Haskell solution: build the array of all lower case with corresponding numbers starting with 1 Prelude> let lowerCaseTable = zip ['a'..'z'] [1..26] A couple of functions: Prelude> let box a = a:[] Prelude>

Re: [Haskell-cafe] How to solve this problem?It's quite easy in PHP.

2007-02-15 Thread Gene A
On 2/13/07, keepbal <[EMAIL PROTECTED]> wrote: For example, (... $arr['a']='1'; $arr['b']='2'; $arr['c']='3'; ...) result: a = 1 b = 2 c = 3 - Haskell solution: build the array of all lower case with corresponding numbers starting with 1 Prelude> let lowerCaseTable = zip ['a'..

Re: [Haskell-cafe] Writing "Haskell For Dummies Or At Least For People Who Feel Like Dummies When They See The Word 'Monad'"

2006-12-12 Thread Gene A
On 12/11/06, Andrew Wagner <[EMAIL PROTECTED]> wrote: > I think there are some great ideas here, and it would be a fantastic > project to do as a community, via a wikibook. .. On 12/11/06, Kirsten Chevalier <[EMAIL PROTECTED]> wrote: there's not really a way to get a publisher to

Re: [Haskell-cafe] How to get subset of a list?

2006-12-07 Thread Gene A
On 11/30/06, Huazhi (Hank) Gong <[EMAIL PROTECTED]> wrote: Thanks, it make sense here. However, like I want to choose s[1,3,6,10] or something like this. Are there some straightforward function or operator for doing this job? The !! operator in haskell seems does not support multiple indecies.

Re: Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Gene A
Nicolas Frisby said: {} The fact of the matter is it's a rare case when a programmer's lack of mathematical background threatens lives. If my GUI crashes, I'm angry but not injured. Programmers make a living without the math background because the vast majority of employers don't seek it--thei

[Haskell-cafe] Re: Haskell wiki: most popular pages

2006-08-22 Thread Gene A
Excerpt from Bulat Ziganshin : i think that definitions with omitted arguments can be more hrd to understand to newbie haskellers, especiallyones who not yet know the language. as Tamas suggests, this page can be used to present to such newbies taste of Haskell so listing all the parameters may a

[Haskell-cafe] Re: Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-22 Thread Gene A
John, Thanks very much for that bit of insight. I am not really writing anything right now that is in more hurry than what Haskell can handle nicely. I was feeling a bit guilty as, Shao said, I use $ over (.) and thought that my code could get some amount of ridicule as to style... when it gets

Re: "class []" proposal Re: [Haskell-cafe] One thought: Num to 0 as ? to list?

2006-08-22 Thread Gene A
Arie said: {... This is an instance of a general conflict: should we sacrifice nice notation for ease of learning? You could make a similar case for list comprehensions, for example: they complicate matters for newcomers (yet another meaning of brackets and pipe) ...} I have to totally agree wi

[Haskell-cafe] Re: Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-21 Thread Gene A
hi, Now, is there a speed or "cleaness of code" advantage to using the function composition method using (.) : putStrLn . return . head $ "This and that" over the application method...using ($): putStrLn $ return $ head "this and that" some thoughts on that ... they both work.. but any advant

[Haskell-cafe] Re: iterative algorithms: how to do it in Haskell?

2006-08-21 Thread Gene A
Hi All, I got up this morning {after not much sleep} to find these very helpful suggestions/comments: from Scott Turner: {... See: http://www.haskell.org/hawiki/ExistentialTypes ...} From Bulat Ziganshin: {... you can read recent discussion on this in this topic, or look at http://haskell.org

[Haskell-cafe] Re: iterative algorithms: how to do it in Haskell?

2006-08-21 Thread Gene A
Lennart and all, On 8/19/06, Lennart Augustsson <[EMAIL PROTECTED]> wrote: There are much better ways than storing strings on the stack. Like using a data type with constructors for the different types that you can store. -- Lennart Off topic, but this is important info for me! O

[Haskell-cafe] Re: Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-21 Thread Gene A
On 8/19/06, Henk-Jan van Tuyl <[EMAIL PROTECTED]> wrote: Or you could use: putStrLn [head "This and that"] Gotta say I really like this ... running the head function inside of the list... Okay so I can really learn something here... what would that look like in "raw" monadic notation? usin

[Haskell-cafe] Useful: putCharLn {inspire by the Int->[Char] thread

2006-08-19 Thread Gene A
The thread on the use of "show" and print to display an Int value, brought up a problem I had early on... the one of cleanly displaying a Char value, on a line all by itself.. My first attempts: This was just plain hard to read: with the character t being where it was: Prelude> putChar $ head "t

[Haskell-cafe] Re: A backwards-compatible record proposal

2006-08-19 Thread Gene A
On 8/19/06, Brian Hulley <[EMAIL PROTECTED]> wrote: {... magSquared v = v.x*v.x + v.y*v.y + v.z*v.z ...} Hi, Won't the use of the "dot" lend confusion to the eye of the beholder.. that as in the code fragment about that v.y or v.z is implying function composition I'll admit to being pretty

[Haskell-cafe] Re: iterative algorithms: how to do it in Haskell?

2006-08-19 Thread Gene A
Hi Lennart, This morning when I posted..it was about 2:30am and had been up a long time... bad habits.. I sent a message to Henk-Jan to that effect, but didn't send to the entire list.. anyway thanks to both for the followups... I still tend to sometimes do things the hard way in Haskell. Start

[Haskell-cafe] Re: iterative algorithms: how to do it in Haskell?

2006-08-19 Thread Gene A
Hi, Here is a little thing I came up with to simulate the construct "for x:= n1 to n2" and "for x:=n1 to n2 by n3" from purely imperative world to use in Haskell, I call the functions fromto and fromtoby.. they also take a function which consumes the x component and uses it in the computation.