Grrr...must...hold...my...tongue...
Dan, as a former student of a clone of that physics teacher, I am really
interested in what you will say when you fail to hold your tongue.
-- Bill Wood
MV I have to admit I was wondering the same thing myself.
So was I.
I started with the obvious
main = getContents = print . tokenise
where tokenise maps its way down a list of characters. This is very
simple, very pleasant, and worked like a charm.
However, the language has an INCLUDE directive, so I'm going to have
to call readFile or something in
When the index is generated with a more recent Haddock, you get a
search field, which does an incremental search, so this might
perhaps be more what you are looking for.
A more aesthetical note: We should really get rid of the ugly
table/CSS layout mixture, the lower part of the page renders
YAHT is available from wikibooks in HTML form.
19.09.2007, в 18:30, Joel Koerwer писал(а):
Hi Paul,
Sorry that my suggestion wasn't so practicable.
On the other hand, I see that the YAHT tex source is available on
darcs.haskell.org/yaht. Maybe we can do something about those
unextractable
Now why isn't pattern matching lazy by default? This seems odd
for a newbie since everything else is lazy by default.
It's even more confusing that pattern matching in 'let' _is_ lazy.
No, it's not.
See, in let or where constructs you don't have a choice; you can't do
different things
reverse = foldl (\x - \xs - xs:x) []
Doesn't typecheck.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
length [1..] 10
isnt lazily evaluated! I wouldnt expect this to be a bug, but
in this case, shouldnt the computation end when the length function
evaluation goes something like:
No. You want GHC to deduce that length would only increase in future.
This property is relatively complex and
Because transpose is quite lazy, it need not necessarily result in a
quadratic time complexity on every use.
On the other hand, my program needs the entire transposed list,
so... ;-)
May be, you should consider some other data structures, for example
(borrowed from fido7.ru.math):
data
How can one function have more than one type signature?
It's called polymorphism.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I would like to, again, strongly argue against sacrificing
compatibility
with Linux/BSD/etc. for the sake of compatibility with OS X or
Windows.
Ehm? I've used to think MacOS is a sort of BSD...
___
Haskell-Cafe mailing list
Building a .tex file can be rather hard with packages and what-not,
plus quite a few of us use lhst2tex as a preprocessor. It's not
impossible, but its not trivial either, and I can't imagine that
anyone would use a .tex over a PDF.
I would prefer the .tex version any day! Why not have both
Is there any really cross-platform GUI library for Haskell?
Gtk2Hs is good (I suppose), but it requires X. OK, I have X, but it's
not native on my Mac; some Mac users don't install it and almost
all Mac users don't always run it.
I was able to install wxHaskell (after some hacking - this
There's a third way, too, and I haven't seen anybody mention it yet
I've noticed it, but there are some problems with this
representation, so I decided not to mention it. It's OK as far as we
don't want functions working on two areas - I don't see, how we can
implement, say, intersect ::
What I should have been told about upfront:
- the syntax for an expression
- the syntax for a block
Don't see your point.
- the adhoc syntax rules (how to distinguish among a tuple and a
pharanthesized expression and how to find the start and end of a block for
example )
Oh, that's
class Shape a where {
intersect :: Shape b = a - b - Bool
}
data Shape a = { intersect :: Shape b = a - b - Bool }
in fact, the syntax is rather similar, too! :)
Um, well, and how are you going to implement it?
___
Haskell-Cafe mailing list
- the syntax for an expression
- the syntax for a block
Don't see your point.
The point is the syntax is introduced as transformation of layout form to
non layout form.
As a user, I just want to be able to spot the basic components of a source
file without thinking about
- the lambda expressions can be written (input) but cannot
be printed (output)
This is a fundamental property of the language. A lambda
expression is programme and at runtime the system doesn't
know one lambda expression from another (all it can do with
one is apply it to something).
As a user, I just want to be able to spot the basic components of a
source
file without thinking about transformation rules.
Well, most users are.
Are what ?
Sorry if I've confused you. English isn't my native language. Are able, of
course.
Have you asked them all ?
If you're
Yes, and Haskell can do it also. But C, I guess, can't print out a
source code for a function (well, there can be some weird dialects of C
I'm not aware about). Haskell can't do it either.
Well, LISP can, if I remember it right.
Only in an interpreter, if I remember it right.
Hmmm, with 'readString ... this /this' everything works fine,
but with 'readString ... itemsthis /this/items' it doesn't.
Seems to be a bug in HXT.
But if I try the same with my XML file, my empty nodes are
folded. I suppose this comes from the Ctrl-M at the end of the
lines.
See the
I can't really reproduce this:
A simple ghci session gives the following:
---
[EMAIL PROTECTED]:~/haskell/hxt/curr/examples/arrows/HelloWorld ghci
HelloWorld.hs
GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking
module Main where
data SquareType numberType = Num numberType = SquareConstructor
numberType
class ShapeInterface shape where
area :: Num numberType = shape-numberType
data ShapeType = forall a. ShapeInterface a = ShapeType a
instance (Num a) = ShapeInterface (SquareType a)
Lazy constant in C:
int C1 (){
return 7;
}
C1 is computed only when you apply the operator () to it.
But that's not the point of lazyness. Lazy value is computed only ONCE.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
That's not C.
That's the C preprocessor, which is a textual substitution macro
language.
Well, the preprocessor is part of the language in a way. These two
come
together.
No. In fact, these are even two different programs, see man cpp.
Macros certainly aren't first class (you can't pass
function's expansion is ... just like macro expansion.
Then you CAN pass a function to another function.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
It is true, however, that preprocessing used to be (in pre-standard
days) separate from the language. This has not been true for decades.
Well, I've seen cpp to be used as a preprocessor not for C sources but for
something else.
___
Haskell-Cafe
Questions:
The fact that Haskell functions are monotone continuous functions on
pointed complete partial orders imply this ?
- every domain in Haskell is a pointed complete partial order, including
domains of functions ?
Right.
- the structure of a domain is preserved in the result
How can I test that partial order in Haskell ?
You can't. It's kinda internal. More specifically, if you try to compute a
value, which is not maximal in this order, you'll get an error or loop forever.
But you still can use such values in your programs if you don't try to compute
them. The
It sounds like a limit. xn -- x for n -- :-)
Yeah, that's right.
How can I get that maximal value when I start from a non maximal one ?
Not a problem. For example, const 1 maps each value (even (_|_)) to the
maximal value 1.
[1 .. ] and x=1:x are maximal ?
Yes.
Right, so when I say to GHCi:
Prelude take 5 [1..]
and it says:
[1,2,3,4,5]
then it really has computed the entirety of the infinite sequence
[1..], and not some approximation?
Of course not! In fact, it doesn't even compute the value 1. It just juggles
with the bytes somehow, so that it
It sounds like a limit. xn -- x for n -- :-)
Yeah, that's right.
If xn is monotone, then I only have to worry when it is not bounded, right
?
Sorry, don't understand what you mean. Yes, the monotone sequence has a limit.
No, it's not necessarily maximal.
[1 .. ] and x=1:x are
I'll bite.
Please, don't.
So what do you expect:
take 5 [1,2,3,4,5,undefined]
to do?
Nothing! It's a value, not an instruction!
So it does seem to matter how much of the list it evaluates...
No, it's implementation details. I'm reasoning about values, not computations,
and I use
take 5 [1,2,3,4,5,undefined]
(What would GHCi print?
[1,2,3,4,5]
Then please square that with your comment that we don't care how much of
the list gets evaluated.)
I don't care if it evaluates it, reads it's answer from some internal table, or
consult it's lawyer. I just want it to
I thought Lisp and Erlang were both infinitely more
popular and better known.
Certainly not infinitely. Lisp isn't entirely functional, and while
Erlang is an industrial success story, I think Haskell is seeing a
wider range of application.
Well, it seems for me that Erlang is much less
? Kay's definition of OOP necessarily implies imperative behaviour.
OCaml has purely functional object update IIRC.
That's OK, but it doesn't seem to agree with Kay's definition. Erlang
definitely does.
___
Haskell-Cafe mailing list
I'm sure you're at least half-joking, but I'll try to answer you
seriously.
the same true for thinking. it's you who believe that people are smart
by itself but computers are smart only in the bounds they programmed
by people. you may believe that human wisdom is created by the Creator
(or
computers don't make mistakes, don't sleep, don't have their own
goals that differ from goals of their society.
To Computers Be The Glory!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ok, please compute 2^2^30 before continuing discussion.
Just for the record: I don't think your computer is able to compute 2^
(2^30).
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
And, pray, what problem does the nature wants to solve that it
thinks in
the way of all history until now?
May be it's calculating sqrt(2)?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
as i've said in other letter,
both computers and humans may be described using mathematics
Erm... What do you really mean by may? I'm pretty sure you can't
give such description right now - otherwise you should already have
several Nobel prizes. It seems reasonable that even if such
In many cases, equality of functions has been decided by humans,
as has
termination of programs. Of course this doesn't prove that humans
can, in
principle, decide equality for any pair of functions. But neither
has the
opposite been proved.
It hasn't been proved that we can't build a
Please, Amateur Philosophy is that way -
Please respect others who have signed up to Haskell-Cafe to discuss
Haskell and not meaningless drivel.
It wasn't intended for me, but I'd like to apologize. I'll try to
stop now, but I'm not sure I'd be able to. I need a
and we already know beautiful examples of scientists being wrong in
their assumptions. to be exact, the whole history of science is
history
of replacing old wrong assumptions with new ones. even most well-known
laws of Newtonian physics become obsolete just 300 years later
That's completely
If I understand correctly, a quantum computer might solve problems in
NP in polynomial time, which is assumed not to be possible for
deterministic computers.
No! Moreover, there is a hypothesis that the only problems quantum
computer can solve in polynomial time are those that the usual
Take the ordinary disjoint union, and then add a new _|_ element,
distinct from both existing copies of _|_ (which are still distinct
from each other).
Now why is that not the category-theoretic coproduct?
h . Left = f and h . Right = g both for _|_ and for finite
elements of the types. And it
That's an interesting task: Design a non-touring complete,
restricted language in which every expression is decidable, without
making the language unusable for usual programming problems.
Well, I did something like that a few years ago - it was a sort of
assembler language, allowing the
data Stack a = Stack { run :: [a] - (a, [a]) }
[...skipped...]
But, I have simply no clue how to fix that. :-(
Can anybody give my a hint?
Yes. It's simply impossible. The Stack data type can't be turned into
a monad.
May be you can explain what do you want to do with this
Yes. It's simply impossible. The Stack data type can't be turned
into a monad.
Why not? Surely this is just a variation on the theme of a state
monad?
Because it can't be turned into a functor. You can't, given a
function a - b, construct a function Stack a - Stack b. On the
contrast,
What kind of code would you write if it would be such monad?
Useless stuff like:
s2 = do
push 11
push 17
count = push
binop (+)
binop (*)
pop
Then you should use something like
data Stack a = Stack {run :: [Integer] -
However, why do I need the parenthes in the second clause? What
does the compiler think I'm trying to do when I type
suma [] = 0
suma h:t = h + suma t
(suma h):t = h + suma t
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Also, how do I represent an AddressBook with an empty list and one
with data on its list for my pattern matching?
phoneLookup (AddressBook []) = Nothing
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
class A a
type T = (forall x.Num x=x)
instance A T
type declares a synonym, like #define in C - but working only on types. So,
essentially, you wrote
instance A (forall x.Num x = x)
which is not very Haskelly.
I am simply trying to state that all members of typeclass Num are of
typeclass
If I say my name is mark twice, it doesn't mean I belong to set of
objects called Mark twice
Yes, but instance declaration doesn't only state that some type
belongs to some class. It also provides some operations on this type.
___
Haskell-Cafe
However, the fact that (0 / 0) == (0 / 0) yields False is quite shocking.
Just for the record: the following is from Firebug (JavaScript debugger for
Firefox) session:
a = 0/0
NaN
a == a
false
a === a
false
___
Haskell-Cafe mailing list
As GNU is not Unix, NaN is not a number,
Since NaN /= NaN, I think, we should decipher NaN as Not a NaN instead.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
The first question I have is it is possible to implement this guy
without wrapping the value in a constructor?
No.
The second question I have is: is there any hope of getting
something like this into the standard library?
It's there already. It's called Identity monad.
MigMit:~ MigMit$ cabal --help
This program is the command line interface to the Haskell Cabal
infrastructure.
See http://www.haskell.org/cabal/ for more information.
^
|
+
On 8 Mar 2010, at 19:51, Andrew Coppin wrote:
OK, so
Maybe it's just me, but I think composition chain is MUCH easier to read.
When readning, I'd probably transform the last version to the previous one by
hand, just to make it more comprehensible.
Sebastian Fischer wrote:
On Mar 10, 2010, at 8:47 AM, Ketil Malde wrote:
I think it is better
1) Haven't look closely, but your second ArrowLoop instance seems righter. The
question really is the same as with MonadFix instances; you can always define
an instance like this
data M = ... -- whatever
instance Monad M where ...
instance MonadFix M where mfix f = mfix f = f
...but this
Out of curiosity: is there something wrong with my nickname migmit?
I'm not gonna change it anyway.
On 6 Apr 2010, at 09:52, Edward Z. Yang wrote:
This is a pretty terrible reason, but I'm going to throw it out there:
I like real names because they're much more aesthetically pleasing.
In
Doesn't seem right. IMHO, the necessity of making windows NOT fullscreen is an
indication of bad design.
Thomas Davie wrote:
On 7 Apr 2010, at 02:53, Ben Millwood wrote:
On Wed, Apr 7, 2010 at 2:22 AM, Thomas Schilling
nomin...@googlemail.com wrote:
I have
set a maximum width on purpose so
Well, what's the sum of an empty list? Seems naturally that it's 0, but why?
Let's say that sum [] = x.
If we take two lists, say, l1 = [1,2,3] and l2 = [4,5], then
sum l1 + sum l2 = 6 + 9 = 15 = sum [1,2,3,4,5] = sum (l1 ++ l2)
We expect it to be the case even if one of the lists is empty,
Forgot about this one:
Bjorn Buckwalter wrote:
What got me thinking about this was the apparently incorrect intuition
that 'and xs' would imply 'or xs'.
No. See, and is very close to for all, and or is similarly close to exists. For example, the statement all crows are black means just this
It's called monad transformers
func1' :: Int - EitherT Error IO String
func1' n = EitherT $ func1 n
func2' :: Int - EitherT Error IO String
func2' s = EitherT $ func2 n
runCalc' :: Int - EitherT Error IO [String]
runCalc' param = func1' param = func2'
runCalc :: Int - IO (Either Error [String])
ErrorT :: IO (Either Error String) - ErrorT Error IO String
I can think that can be written as
ErrorT :: IO (Either Error String) - ErrorT Error (IO String)
Am I correct?
No, you're not. Similar to function application, type application is
also left-associative, so it can (but shouldn't)
(= f) is equivalent to (flip (=) f), not to ((=) f). You can try this
with your own function this way:
($^) :: (Monad m) = m a - (a - m b) - m b
($^) = undefined
:t ($^ f)
Milind Patil wrote:
For a function
f :: a - m b
f = undefined
I am having trouble understanding how the type of
(=
On 19 May 2010, at 08:35, Ivan Miljenovic wrote:
This looks suspiciously like homework...
2010/5/19 R J rj248...@hotmail.com:
What are some simple functions that would naturally have the
following type
signatures:
f :: (Integer - Integer) - Integer
I can only think of one solution to
That won't be a great idea; if I just want my monad to be declared as one, I
would have to write
instance Functor MyMonad where fmap = ...
instance Pointed MyMonad where pure = ...
instance Applicative MyMonad where (*) = ...
instance Monad MyMonad where join = ...
Compare this with
instance
From Prelude.hs:
class (Eq a) = Ord a where
compare :: a - a - Ordering
(), (=), (), (=) :: a - a - Bool
max, min :: a - a - a
compare x y = if x == y then EQ
-- NB: must be '=' not '' to validate the
-- above claim
listFs = [f1, f2, f3]
map ($ x) listFs -- same as [f1 x, f2 x, f3 x]
f x y z = ...
map (\x - f x u v) xs
On 17 Jun 2010, at 23:02, Martin Drautzburg wrote:
Hello all
The standard map function applies a single function to a list of
arguments.
But what if I want to apply a list of functions
The class Num has subclasses containing various numeric types and the
literal 1 is a value for one or more of those types.
Well, the problem is not with subclasses, but with types.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
GADTs?
data CompletePathEv p where CompletePathEv :: CompletePath p =
CompletePathEv p
class Path p = IncompletePath p where
type CompletedPath p :: *
completedPathEv :: CompletePathEv (CompletedPath p)
Later you can pattern-match on completedPathEv and get your
CompletePath
People still use Hugs? :p
Is there another option for quick prototyping on iPhone?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
My guess is that it's
class B : public A
and
class C : public A
In this case it seems perfect to use type classes:
class A t where do_x :: t - Integer - Integer - Integer
data B = ...
instance A B where do_x b x y = ...
data C = ...
instance A C where do_x c x y = ...
If you want some general
of the haskell textbooks, and if anyone knows of a good
in-depth treatment of this, I would be grateful for a pointer.
Thanks again to everyone who responded,
Simon
On Mon, Jul 5, 2010 at 2:28 PM, Miguel Mitrofanov miguelim...@yandex.ru
mailto:miguelim...@yandex.ru wrote:
My guess is that it's
Well, Linux fanboys are known for spending too much time with their
computers compiling OS kernel or building world, no surprise their
eyes aren't in place.
On 18 Jul 2010, at 02:54, bri...@aracnet.com wrote:
On Sat, 17 Jul 2010 18:02:05 -0400
Brandon S Allbery KF8NH allb...@ece.cmu.edu
chr . ord $ 'å'
'\229'
What would I have to do to get an 'å' from '229'?
It seems you already have it; 'å' is the same as '\229'. But IO output is still
8-bit, so when you ask ghci to print 'å', you get '\229'. You can use
utf-string library (from hackage).
On 29 Jan 2008, at 20:21, Anton van Straaten wrote:
Froprakxculmizum troodulifnax!
Bless you!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
1. Are Haskell monads useful in a truly categorical sense?
2. Is Haskell's functor class misnamed?
3. Haskell arrows and Haskell monads have a misleading relationship
I'm confused. It seems for me that either I don't understand math or I
don't understand you.
1. Categorical monads are a
Problem is that from the idea Functor is a superclass of Monad, with
the
property that fmap == liftM.
[cut]
The second relation can even not be expressed in Haskell 98.
Erm...
class Functor f where
fmap :: (a - b) - f a - f b
class Functor m = Monad m where
return :: a - m a
invM :: Maybe a - Maybe ()
invM Nothing = Just ()
invM (Just _) = Nothing
invL :: [] a - [] ()
invL []= [()]
invL (_:_) = []
How can I define this for an arbitrary Monad m?
Such as Identity?
___
Haskell-Cafe mailing list
Such as Identity?
Well in:
inv :: (Monad m, ...) = m a - m ()
inv m = ...
I don't mind that there are more constraints on 'm' than just Monad
class Monad m = MonadInv m where inv :: m a - m ()
With this constraint you certainly can have your inv.
(x = f) = g == x = (\v - f v = g)
However, this seems to me a kind of mathematical identity. If it is
mathematical identity, a programmer need not care about this law to
implement a monad. Can anyone give me an example implementation of
monad that violate this law ?
It's well known that ListT
Does it start with Any sequence of KLUDGES, not necessarily distinct
or finite...? If so, it can be found in The Computer
Contradictionary, by the same author, and probably illegal copy of
the last book can be found in the net somewhere.
On 2 Mar 2008, at 19:53, Paul Johnson wrote:
I was
Well, we have at least one very useful example of adjunction. It's
called curry. See, if X is some arbitrary type, you can define
type F = (,X)
instance Functor F where
fmap f (a,x) = (fa,x)
type G = (-) X
instance Functor G where
fmap f h = \x - f (h x)
Now, we have the adjunction:
Well, I think it's really cool to be sitting in cafe exchanging some
сute facts from category theory we happen to know. Girls would
definitely like it.
On 5 Mar 2008, at 03:33, Derek Elkins wrote:
On Tue, 2008-03-04 at 19:01 +, Dominic Steinitz wrote:
Well, we have at least one very
Exercise:
Show how the single comprehension [(x,y) | x - [1,2,3], y -
[4,5,6]] with two generators can be re-expressed using two
comprehensions with single generators.
Hint: make use of the library function _concat_.
Another hint: it can be rewritten as
concatMap (\x - concatMap (\y -
Hmmm, seems like your (-+) is not lazy enough.
Since pattern matching is strict by default, you have
anything -+ (_|_) = (_|_)
Therefore, the function, which is constantly (_|_), is a fixed point
for the equation defining h. In other words, if you define
h' x = undefined
then you have
h'
I don't know if it is a bug, but
1 = 0 (mod 2^32),
so, if GHC considers exponent as Int (not Integer), then it's the same
as 1e0 = 1. In the same way,
9 = -1 (mod 2^32),
and 1e-(-1) = 1e1 = 10.
Note
Generic Haskell includes the following features:
* type-indexed values -- generic functions that can be
instantiated on all Haskell data types.
How come I haven't ever heard about such a thing?!
___
Haskell-Cafe mailing list
It has nothing to do with State; it actually works in List monad.
return y is just another way of writing [y].
You don't need to import Control.Monad.State for this to work; you
only need Control.Monad (which is imported by the former).
On 16 Apr 2008, at 16:56, Hans Aberg wrote:
When I
Before somebody noticed: I'm wrong.
It's not List monad, but also a (-) x monad, also defined in
Control.Monad.
Therefore, return y is just const y. Therefore,
x = (return y) = x = (const y) = x y
On 16 Apr 2008, at 17:04, Miguel Mitrofanov wrote:
It has nothing to do with State
You are insulting other Unixes. It works on Mac OS X, for example.
On 16 Apr 2008, at 19:16, John Goerzen wrote:
On 2008-04-15, Joe Buehler [EMAIL PROTECTED] wrote:
John Goerzen wrote:
So I have a need to write data to a POSIX named pipe (aka FIFO).
Long
story involving a command that
[1]
funk f x = f (funk f) x
f :: a
x :: b
funk f x :: c
therefore funk :: a - b - c
RHS
f (funk f) x :: c
f (funk f) :: d - c
x :: d
f :: e - d - c
funk :: h - e
f :: h
Copy-paste approach's failed you. Hint: try removing acountL
definition and compiling everything else.
-- count with tail calls for the left subtree
acountL :: Tree - Integer - Integer
acountL (Leaf _) acc = acc + 1
acountL (Branch t1 t2) acc = acountL t1 $! (acountL t2 acc)
-- count
On 9 May 2008, at 21:52, PR Stanley wrote:
Hi
(take 4 . map (0)) (f s t)
where
s = 2 : t
t = 3 : s
f = zipWith (-)
What would be the order of evaluation for the above code? How would
I illustrate the evaluation step-by-step?
What do you need it for, really? Pure functional
As I understand it Haskell does not specify an order of evaluation
and it would therefore be a mistake to write a program which relies
on a particular evaluation order. This is the 'unsafe' aspect of
unsafePerformIO.
Hmm... IMHO unsafePerformIO is 'unsafe' because it can lead to type
errors
On 10 May 2008, at 00:43, Dan Piponi wrote:
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
use unsafePerformIO. Indeed, it is possible to write
coerce :: a - b with the help of unsafePerformIO. So be careful!
/quote
That's the reason why f has sometimes LESS general type than \x -
f x in OCaml.
On 10 May 2008, at 01:34, Achim Schneider wrote:
Miguel Mitrofanov [EMAIL PROTECTED
Seems to be close to
sequence :: [ListT m a] - ListT m a
Hmm?
On 16 May 2008, at 14:12, Alistair Bayley wrote:
A couple of days ago I had need for:
concatM :: Monad m = [m [a]] - m [a]
concatM = liftM concat . sequence
but found no such thing in the std libs, except perhaps for msum (I
1 - 100 of 406 matches
Mail list logo