Is there a handy list of operators and their precedence somewhere?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
, Daniel Díaz lazy.dd...@gmail.com wrote:
From: Daniel Díaz lazy.dd...@gmail.com
Subject: Re: [Haskell-cafe] Operator precedence
To: michael rice nowg...@yahoo.com, haskell-cafe@haskell.org
Date: Monday, September 6, 2010, 1:06 PM
Take a look to the Haskell Report:
http://www.haskell.org
Subject: Re: [Haskell-cafe] Operator precedence
To: michael rice nowg...@yahoo.com, haskell-cafe@haskell.org
Date: Monday, September 6, 2010, 1:17 PM
Those are all operators in Prelude. See a concrete library for their operator
precedences.
--
Daniel Díaz
] Operator precedence
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org, Daniel Díaz lazy.dd...@gmail.com
Date: Monday, September 6, 2010, 1:50 PM
On Mon, Sep 6, 2010 at 1:37 PM, michael rice nowg...@yahoo.com wrote:
A concrete library?
I'm playing around with Data.Bits. It has
The two myAction functions below seem to be equivalent and, for this small
case, show an interesting economy of code, but being far from a Haskell expert,
I have to ask, is the first function as small (code wise) as it could be?
Michael
import Control.Applicative
data Color
= Red
|
d...@zednenem.com wrote:
From: David Menendez d...@zednenem.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, September 4, 2010, 2:23 PM
On Sat, Sep 4, 2010 at 2:06 PM, michael rice nowg...@yahoo.com wrote:
The two
...@mathematik.uni-marburg.de
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Wednesday, September 1, 2010, 5:28 PM
michael rice wrote:
Prelude Data.Either let m = Just 7
Prelude Data.Either :t m
m :: Maybe Integer
So to create a value
--- On Tue, 8/31/10, Ryan Ingram ryani.s...@gmail.com wrote:
From: Ryan Ingram ryani.s...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: Vo Minh Thu not...@gmail.com, haskell-cafe@haskell.org
Date: Tuesday, August 31, 2010, 4:17 PM
FmapFunc is just a test
a...@2piix.com wrote:
From: Alexander Solla a...@2piix.com
Subject: Re: [Haskell-cafe] On to applicative
To:
Cc: haskell-cafe Cafe haskell-cafe@haskell.org
Date: Thursday, September 2, 2010, 2:46 PM
On Sep 2, 2010, at 11:30 AM, michael rice wrote:
In each case, what does the notation
show
This may be a dumb question, but here goes.
Types Maybe, Either, List, are types and also instances of Functor (and Monad).
Assuming (-) is also a type, where can I find its type definition?
Michael
___
Haskell-Cafe mailing list
Cool, I'll go looking for it. I couldn't find anything on Hoogle.
Thanks,
Michael
--- On Thu, 9/2/10, David Menendez d...@zednenem.com wrote:
From: David Menendez d...@zednenem.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
that would require x to have a declared type, or is it always inferred by the
type of f?
Michael
--- On Wed, 9/1/10, Tillmann Rendel ren...@mathematik.uni-marburg.de wrote:
From: Tillmann Rendel ren...@mathematik.uni-marburg.de
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice
Learn You a Haskell ... says that (-) is a type just like Either. Where can
I find its type definition?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
So it's a type constructor, not a type? Could you please provide a simple
example of its usage?
Michael
--- On Tue, 8/31/10, Vo Minh Thu not...@gmail.com wrote:
From: Vo Minh Thu not...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe
of (-) so I can apply (-)'s version of
fmap
instance Functor ((-) r) where
fmap f g = (\x - f (g x))
to it?
Michael
--- On Tue, 8/31/10, Vo Minh Thu not...@gmail.com wrote:
From: Vo Minh Thu not...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc
...@gmail.com wrote:
From: Ryan Ingram ryani.s...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: Vo Minh Thu not...@gmail.com, haskell-cafe@haskell.org
Date: Tuesday, August 31, 2010, 2:36 PM
Prelude FmapFunc let s = show :: ((-) Int) String
Prelude
Hi Vo,
Pardon, I grabbed the wrong lines.
*Main :t (-) 3 abc
interactive:1:1: parse error on input `-'
Michael
--- On Tue, 8/31/10, Vo Minh Thu not...@gmail.com wrote:
From: Vo Minh Thu not...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: Ryan
: Vo Minh Thu not...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: Ryan Ingram ryani.s...@gmail.com, haskell-cafe@haskell.org
Date: Tuesday, August 31, 2010, 3:23 PM
2010/8/31 michael rice nowg...@yahoo.com
Hi Vo,
Pardon, I grabbed the wrong lines
, 4:35 PM
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 8/31/10 13:27 , michael rice wrote:
So it's a type constructor, not a type? Could you please provide a simple
example of its usage?
Assuming you don't mean the trivial use in defining functions, see
Control.Monad.Instances:
instance
: SHA1
On 8/28/10 20:43 , michael rice wrote:
I'm looking at a discussion of Either (as functor) here:
http://learnyouahaskell.com/making-our-own-types-and-typeclasses#the-functor-typeclass
instance Functor (Either a) where
fmap f (Right x) = Right (f x)
fmap f (Left x) = Left x
, 8/30/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org, Brandon S Allbery KF8NH allb...@ece.cmu.edu
Date: Monday, August 30
I'm looking at a discussion of Either (as functor) here:
http://learnyouahaskell.com/making-our-own-types-and-typeclasses#the-functor-typeclass
instance Functor (Either a) where
fmap f (Right x) = Right (f x)
fmap f (Left x) = Left x
And this line in Data.Either
Functor (Either
Thanks, Brandon.
Michael
--- On Sat, 8/28/10, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote:
From: Brandon S Allbery KF8NH allb...@ece.cmu.edu
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, August 28, 2010, 10:43
fmap seems oddly named because no mapping takes place, except in the fourth
example, where the map is passed in. Just sayin'.
Michael
1)
Prelude Control.Monad Control.Applicative fmap (++ abc) getLine
xyz
xyzabc
2)
Prelude Control.Monad Control.Applicative Data.Char Data.String fmap (splitAt
A map can be a function (applied to a (single) value).
Got it.
Thanks,
Michael
--- On Fri, 8/27/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc
Yeah, I figured as much, but the code is copied right off the referenced page.
Michael
--- On Thu, 8/26/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg
Can you recommend an example that works?
Michael
--- On Thu, 8/26/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date
--- On Thu, 8/26/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Thursday, August 26, 2010, 2:33 AM
On 26 August 2010 16
: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Thursday, August 26, 2010, 2:50 AM
On 26 August 2010 16:47, michael rice nowg...@yahoo.com wrote:
OK, fmap2 works, but not fmap3. What am I not understanding?
Michael
import
the patience.
Michael
--- On Thu, 8/26/10, Thomas Davie tom.da...@gmail.com wrote:
From: Thomas Davie tom.da...@gmail.com
Subject: Re: [Haskell-cafe] On to applicative
To: michael rice nowg...@yahoo.com
Cc: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com,
haskell-cafe@haskell.org
Date: Thursday
Date: Thursday, August 26, 2010, 4:29 AM
On Aug 26, 2010, at 12:34 AM, michael rice wrote:
A lot of stuff to get one's head around. Was aware of liftM2, liftM3, etc.,
but not liftA2, liftA3, etc.
liftM and liftA are essentially equivalent (and are both essentially equivalent
to fmap
, 2:15 PM
On Aug 26, 2010, at 9:27 AM, michael rice wrote:
Some functions just happen to map to other functions.
$ is flip fmap. f $ functor = fmap f functor Brent Yorgey's post
noted.
map to? Take as arguments?
maps to as in outputs.
pure f * functor = f $ functor
From: http://en.wikibooks.org/wiki/Haskell/Applicative_Functors
=
import Control.Applicative
f :: (a - b - c)
fmap :: Functor f = (d - e) - f d - f e
fmap f :: Functor f = f a - f (b - c) -- Identify d with a, and e with (b
- c)
sumsqr :: Int - Int - Int -- my
--- On Sat, 8/14/10, Felipe Lessa felipe.le...@gmail.com wrote:
From: Felipe Lessa felipe.le...@gmail.com
Subject: Re: [Haskell-cafe] Unwrapping long lines in text files
To: Bill Atkins watk...@alum.rpi.edu
Cc: michael rice nowg...@yahoo.com, haskell-cafe@haskell.org
Date: Saturday, August 14, 2010
Hi Bill,
Very clever.
You are an inspiration.
Michael
--- On Sat, 8/14/10, Bill Atkins watk...@alum.rpi.edu wrote:
From: Bill Atkins watk...@alum.rpi.edu
Subject: Re: [Haskell-cafe] Unwrapping long lines in text files
To: michael rice nowg...@yahoo.com
Cc: Felipe Lessa felipe.le...@gmail.com
rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, August 14, 2010, 7:07 PM
On Sat, Aug 14, 2010 at 2:38 AM, michael rice nowg...@yahoo.com wrote:
The program below takes a text file and unwraps all lines to 72 columns, but
I'm getting an end of file message at the top of my
Nope. No redirection.
Michael
--- On Sat, 8/14/10, Brandon S Allbery KF8NH allb...@ece.cmu.edu wrote:
From: Brandon S Allbery KF8NH allb...@ece.cmu.edu
Subject: Re: [Haskell-cafe] Unwrapping long lines in text files
To: haskell-cafe@haskell.org
Date: Saturday, August 14, 2010, 7:17 PM
The program below takes a text file and unwraps all lines to 72 columns, but
I'm getting an end of file message at the top of my output.
How do I lose the EOF?
Michael
== unwrap.hs ==
main = do
line - getLine
if null line
then do
putStrLn
, 8/13/10, Bill Atkins watk...@alum.rpi.edu wrote:
From: Bill Atkins watk...@alum.rpi.edu
Subject: Re: [Haskell-cafe] Unwrapping long lines in text files
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Friday, August 13, 2010, 11:13 PM
Not sure if I understood what you're
From: Learn You a Haskell
===
Remember let bindings? If you don't, refresh your memory on them by reading
this section. They have to be in the form of let bindings in expression, where
bindings are names to be given to expressions and expression is the expression
that is to
= do
gen - getStdGen
let code = genCode gen
putStrLn $ Code is ++ show code
putStrLn ...
Michael
--- On Tue, 8/10/10, Job Vranish job.vran...@gmail.com wrote:
From: Job Vranish job.vran...@gmail.com
Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do*
To: michael rice
s6?
Michael
--- On Tue, 8/10/10, Tillmann Rendel ren...@mathematik.uni-marburg.de wrote:
From: Tillmann Rendel ren...@mathematik.uni-marburg.de
Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do*
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date
So all the Xs would be in scope at s6. Important point.
Thanks,
Michael
--- On Tue, 8/10/10, Alex Stangl a...@stangl.us wrote:
From: Alex Stangl a...@stangl.us
Subject: Re: [Haskell-cafe] Couple of questions about *let* within *do*
To: michael rice nowg...@yahoo.com
Cc: Tillmann Rendel ren
What is - ? Couldn't find anything on Hoogle.
1) main = do
x - getLine -- get the value from the IO monad
putStrLn $ You typed: ++ x
2) pythags = do
z - [1..] --get the value from the List monad?
x - [1..z]
y - [x..z]
guard (x^2 + y^2 == z^2)
getLine = \x - -- x is a string at this point
[1..] = \x - -- x is WHAT at this point?
MIchael
--- On Sun, 8/8/10, Henning Thielemann lemm...@henning-thielemann.de wrote:
From: Henning Thielemann lemm...@henning-thielemann.de
Subject: Re: [Haskell-cafe] What is -
To: michael rice
-cafe] What is -
To: michael rice nowg...@yahoo.com
Date: Sunday, August 8, 2010, 11:01 AM
On Sun, 8 Aug 2010, michael rice wrote:
How would I print each of these integers, one per line?
[1,2,3,4,5] = \x - ?
You can't do this from inside the List monad, but you can easily do it from
outside
From: Data.Complex
data (RealFloat a) = Complex a
= !a :+ !a
What's the purpose of the exclamation marks?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, July 31, 2010, 9:32 AM
michael rice nowg...@yahoo.com writes:
From: Data.Complex
data (RealFloat a) = Complex a
= !a :+ !a
What's the purpose of the exclamation marks?
Forcing; it means that the values are evaluated (up
Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] Constructor question
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, July 31, 2010, 9:32 AM
michael rice nowg...@yahoo.com writes:
From
Ok, got ! and WHNF.
Thanks,
Michael
--- On Sat, 7/31/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] Constructor question
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday
From: http://en.wikibooks.org/wiki/Haskell/Laziness
Given two functions of one parameter, f and g, we say f is stricter than g if f
x evaluates x to a deeper level than g x
Exercises
1. Which is the stricter function?
f x = length [head x]
g x = length (tail x)
Prelude let f x = length
rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, July 31, 2010, 12:38 PM
On Sat, Jul 31, 2010 at 4:56 PM, michael rice nowg...@yahoo.com wrote:
From: http://en.wikibooks.org/wiki/Haskell/Laziness
Given two functions of one parameter, f and g, we say f is stricter than g
question
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Saturday, July 31, 2010, 1:47 PM
On Sat, Jul 31, 2010 at 5:59 PM, michael rice nowg...@yahoo.com wrote:
OK, in f, *length* already knows it's argument is a list.
In g, *length* doesn't know what's inside the parens, extra
Date: Saturday, July 31, 2010, 2:29 PM
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 7/31/10 14:24 , michael rice wrote:
Are you saying:
[ head x ] - [ *thunk* ] and length [ *thunk* ] - 1, independent of
what *thunk* is, even head [], i.e., *thunk* never needs be evaluated
From: Data.Maybe
Description
The Maybe type, and associated operations.
From: Data.List
Description
Operations on lists.
One description has the type and associated operations, the other only has the
operations.
Where can I find the type definition for List, and why isn't it in Data.List?
for
defining this stuff, i.e., this goes here, that goes there?
Michael
--- On Fri, 7/30/10, Edward Z. Yang ezy...@mit.edu wrote:
From: Edward Z. Yang ezy...@mit.edu
Subject: Re: [Haskell-cafe] Definition of List type?
To: michael rice nowg...@yahoo.com, haskell-cafe
haskell-cafe@haskell.org
Date
, Daniel Fischer daniel.is.fisc...@web.de wrote:
From: Daniel Fischer daniel.is.fisc...@web.de
Subject: Re: [Haskell-cafe] Definition of List type?
To: haskell-cafe@haskell.org
Cc: michael rice nowg...@yahoo.com
Date: Friday, July 30, 2010, 4:23 PM
On Friday 30 July 2010 21:54:20, michael rice wrote
How do I import Control.Monad.State?
I see this note in
http://en.wikibooks.org/wiki/Haskell/Understanding_monads/State
Note: in some package systems used for GHC, the Control.Monad.State module is
in a separate package, usually indicated by MTL (Monad Transformer Library).
Michael
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Tuesday, July 27, 2010, 10:51 PM
On 28 July 2010 12:39, michael rice nowg...@yahoo.com wrote:
How do I import Control.Monad.State?
Install and use the mtl library (comes with the Haskell platform),
monads-fd (almost identical API
See below. Lot's of warnings. Is the install OK? If so, can I use the same
*import*?
Michael
--- On Tue, 7/27/10, Ivan Miljenovic ivan.miljeno...@gmail.com wrote:
If it isn't installed, you can use cabal-install to install it:
cabal install mtl
--
Ivan Lazar Miljenovic
, Lyndon Maydwell maydw...@gmail.com wrote:
From: Lyndon Maydwell maydw...@gmail.com
Subject: Re: [Haskell-cafe] Random this! ;-)
To: michael rice nowg...@yahoo.com
Cc: Max Rabkin max.rab...@gmail.com, Ozgur Akgun ozgurak...@gmail.com,
haskell-cafe@haskell.org
Date: Monday, July 26, 2010, 8:29 AM
I find
Hi All,
From: http://en.wikibooks.org/wiki/Haskell/Understanding_monads/State
Exercises
1. Implement a function rollNDiceIO :: Int - IO [Int] that,
given an integer, returns a list with that number of pseudo-
random integers between 1 and 6.
After a
: [Haskell-cafe] Random this! ;-)
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Sunday, July 25, 2010, 11:44 AM
On Sun, Jul 25, 2010 at 5:39 PM, michael rice nowg...@yahoo.com wrote:
I know, ugly, but at least I got it to work. What's a better way to generate
this list
Cool. Everything's there but the N.
Learning Haskell is a lot like learning to dance.
Michael
--- On Sun, 7/25/10, Ozgur Akgun ozgurak...@gmail.com wrote:
From: Ozgur Akgun ozgurak...@gmail.com
Subject: Re: [Haskell-cafe] Random this! ;-)
To: Max Rabkin max.rab...@gmail.com
Cc: michael rice
Prelude Control.Monad liftM2 (\a b - a : b : []) abc 123
[a1,a2,a3,b1,b2,b3,c1,c2,c3]
Prelude Control.Monad
Got it!
Thanks to all.
Michael
--- On Sat, 7/24/10, aditya siram aditya.si...@gmail.com wrote:
From: aditya siram aditya.si...@gmail.com
Subject: Re: [Haskell-cafe] Heavy lift-ing
To:
This works:
Prelude System.Random do { randomRIO (1,6) = (\x - putStrLn $ Value = ++
show x) }
Value = 5
So does this:
Prelude System.Random do { x - randomRIO (1,6); putStrLn $ Value = ++ show
x }
Value = 2
But not this:
1 import Control.Monad
2 import System.Random
3
4 foo :: IO ()
5
Thanks, Tobias. I figured it was something like that but lack the syntax
expertise on where to put it.
MIchael
--- On Sat, 7/24/10, Tobias Brandt tob.bra...@googlemail.com wrote:
From: Tobias Brandt tob.bra...@googlemail.com
Subject: Re: [Haskell-cafe] Type problems
To: michael rice nowg
Hi,
I don't understand what's taking place here.
From Hoogle:
=
liftM2 :: Monad m = (a1 - a2 - r) - m a1 - m a2 - m r
Promote a function to a monad, scanning the monadic arguments from left to
right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3]
liftM2 (+) (Just
wrote:
From: Jürgen Doser jurgen.do...@gmail.com
Subject: Re: [Haskell-cafe] Heavy lift-ing
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Friday, July 23, 2010, 4:50 PM
El vie, 23-07-2010 a las 15:05 -0400, Nick Bowler escribió:
On 11:43 Fri 23 Jul , michael rice
When I'm learning a new language I like to translate old programs into the new
language as a test of my understanding. However, many of the old programs are
from old programming texts, many written in the time of punch-cards for batch
processing, and many containing significant amounts of code
...@malde.org
Subject: Re: [Haskell-cafe] Testing for valid data
To: haskell-cafe@haskell.org
Date: Saturday, March 27, 2010, 5:20 PM
michael rice nowg...@yahoo.com writes:
When I'm learning a new language I like to translate old programs into
the new language as a test of my understanding. However
Subject: Re: [Haskell-cafe] Using regexps to filter data
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Monday, March 15, 2010, 10:09 AM
On 15 March 2010 14:02, michael rice nowg...@yahoo.com wrote:
Thanks. Looks kind of complicated. Are there any examples of how to use
Is there a library function that will create two lists from one based on a
predicate, one list for all elements that satisfy the predicate and one for all
that do not? Don't want to reinvent the wheel.
Michael
___
Haskell-Cafe mailing list
Most excellent! Thanks.
Michael
--- On Sun, 3/14/10, Stephen Tetley stephen.tet...@gmail.com wrote:
From: Stephen Tetley stephen.tet...@gmail.com
Subject: Re: [Haskell-cafe] Splitting list with predicate
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Sunday, March 14
Thanks all,
Wouldn't one need to know the order of the arguments?
(a - Bool) - [a] - ([a], [a])
Michael
--- On Sun, 3/14/10, Simon Hengel simon.hen...@wiktory.org wrote:
From: Simon Hengel simon.hen...@wiktory.org
Subject: Re: [Haskell-cafe] Splitting list with predicate
To: michael rice
Cool. Will keep that in mind next time I'm looking for an operation but don't
know what it's called.
Michael
--- On Sun, 3/14/10, Simon Hengel simon.hen...@wiktory.org wrote:
From: Simon Hengel simon.hen...@wiktory.org
Subject: Re: [Haskell-cafe] Splitting list with predicate
To: michael rice
Not sure I'm even in the right neighborhood with this. Need to screen for
integer data.
Am I going about this correctly?
Michael
==
[mich...@localhost ~]$ ghci
GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package
Not using Stack for anything, just trying to understand how things can be done
in Haskell.
To that end...
What's going on here? I'm not even calling function POP.
Michael
==
module Data.Stack (Stack, emptyStack, isEmptyStack, push, pop, top) where
newtype Stack a = Stack
] Stack ADT?
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org, Casey Hawthorne cas...@istar.ca
Date: Friday, February 5, 2010, 11:04 AM
2010/2/5 michael rice nowg...@yahoo.com
Not using Stack for anything, just trying to understand how things can be
done in Haskell.
To that end
Can't find a Stack datatype on Hoogle? Where should I look?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
: Sebastian Fischer s...@informatik.uni-kiel.de
Subject: Re: [Haskell-cafe] Stack ADT?
To: haskell-cafe Cafe haskell-cafe@haskell.org
Date: Thursday, February 4, 2010, 12:16 PM
On Feb 4, 2010, at 6:07 PM, michael rice wrote:
Can't find a Stack datatype on Hoogle? Where should I look?
Could
I'm not sure where I got this PICK function from, and don't understand why it's
written as it is, so I wanted to test it for randomness. It seems random
enough. But if I understand the algorithm correctly, instead of selecting one
of the elements from the list, it eliminates all the elements
: Saturday, January 30, 2010, 6:06 PM
On Jan 30, 2010, at 8:59 PM, michael rice wrote:
I'm not sure where I got this PICK function from, and don't understand why
it's written as it is, so I wanted to test it for randomness. It seems random
enough.
We can convince ourselves using reason
Just noticed this difference in the definition of fromMaybe in two different
places:
http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/src/Data-Maybe.html#fromMaybe
-- | The 'fromMaybe' function takes a default value and and 'Maybe'
-- value. If the 'Maybe' is 'Nothing', it
not.
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe haskell-cafe@haskell.org
Date: Tuesday, January 26, 2010, 10:52 PM
Excerpts from michael rice's message of Tue Jan 26 21:34:42 -0500 2010:
fromMaybe d x = case x of {Nothing - d;Just v - v}
fromMaybe z = maybe z id
They're equivalent. Here
...@malde.org
Subject: Re: [Haskell-cafe] Having a look at XMonad window manager
To: michael rice nowg...@yahoo.com
Cc: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com,
haskell-cafe@haskell.org
Date: Wednesday, January 20, 2010, 1:20 AM
michael rice nowg...@yahoo.com writes:
Perhaps. Is there a Linux
It seems I was doing MUCH more than I needed to do to have a look at XMonad in
action. I went back and created a .xsession file with just one line:
xmonad
I then disabled Nautilus (unchecked show desktop) and started xmonad as follows
killall metacity; xmonad
Everything now seems to work
How did you configure it? Are you still using it?
Michael
--- On Tue, 1/19/10, Chaddaï Fouché chaddai.fou...@gmail.com wrote:
From: Chaddaï Fouché chaddai.fou...@gmail.com
Subject: Re: [Haskell-cafe] Having a look at XMonad window manager
To: John Millikin jmilli...@gmail.com
Cc: michael rice
I downloaded XMonad from the Fedora 12 repository and would like to see it in
action.
What must I do to get it working from the Gnome desktop environment?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Subject: Re: [Haskell-cafe] Having a look at XMonad window manager
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Monday, January 18, 2010, 1:57 PM
michael rice nowg...@yahoo.com writes:
I downloaded XMonad from the Fedora 12 repository and would like to see it in
action
~]$
I added /usr/bin/xmonad to startup applications.
All these things were suggested.
Michael
--- On Mon, 1/18/10, Don Stewart d...@galois.com wrote:
From: Don Stewart d...@galois.com
Subject: Re: [Haskell-cafe] Having a look at XMonad window manager
To: michael rice nowg...@yahoo.com
Cc: Ivan
Perhaps. Is there a Linux distro that's more XMonad friendly?
Michael
--- On Mon, 1/18/10, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote:
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com
Subject: Re: [Haskell-cafe] Having a look at XMonad window manager
To: michael rice nowg
I don't see anything wrong with this function, which just subtracts 1 from the
first element of an Int list (if there is a first element).
Michael
My function:
dropFirst :: [Int] - [Int]
dropFirst [] = []
dropFirst (x:xs) = (x-1) : xs
My output:
:l dropfirst
[1 of 1] Compiling Main
, January 16, 2010, 10:05 PM
在 2010年 1月 17日 星期日 11:02:59,michael rice 寫道:
I don't see anything wrong with this function, which just subtracts 1 from
the first element of an Int list (if there is a first element).
Michael
My function:
dropFirst :: [Int] - [Int]
dropFirst
I've seen the terms lazy evaluation and lazy function. Is this just lazy
language or are both these terms valid?
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Can someone provide a simple example of tracing a function.
Michael
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
= memo_walk_count (n-2) + memo_walk_count (n-1)
in (map walk_count [0..] !!)
--- On Thu, 12/24/09, Daniel Fischer daniel.is.fisc...@web.de wrote:
From: Daniel Fischer daniel.is.fisc...@web.de
Subject: Re: [Haskell-cafe] trace
To: haskell-cafe@haskell.org
Cc: michael rice nowg...@yahoo.com
Date
Thanks all,
OK, so this definition of fib
fib 0 = 1
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
would involve a lot of recomputation for some large n, which memoization would
eliminate?
Michael
--- On Wed, 12/16/09, michael rice nowg...@yahoo.com wrote:
From: michael rice nowg...@yahoo.com
Based upon docs I've looked at, Haskell seems to store both an array element
value AND its index/indices, whereas most languages just store the value and
find its location in memory through mapping calculations.
Is it true?
Michael
___
Peebles pumpkin...@gmail.com wrote:
From: Daniel Peebles pumpkin...@gmail.com
Subject: Re: [Haskell-cafe] Haskell arrays
To: michael rice nowg...@yahoo.com
Cc: haskell-cafe@haskell.org
Date: Wednesday, December 16, 2009, 10:46 PM
It doesn't store both, but does provides a flexible indexing strategy
101 - 200 of 361 matches
Mail list logo