I don't think I would quite say haskell-game is quite relevant. For that
matter, the implementation on GitHub is not very good. It's too complicated
to scale and too specialized. I've been starting a fresh implementation,
since I learned a lot about what I really want to do writing that, but it
is
Ah! It seems that my wording was ambiguous. All I was trying to say is that
there is nothing you can do with an IO action which will cause an otherwise
pure expression to exhibit side effects during evaluation, *not* that an IO
action is observable in pure code or that they are arbitrarily manipula
I don't know what the denotation for this would be, but I can't think of
any reasonable ones for which I can write (==) to respect the denotation.
For example, is "set A, then set B" equal to "set B, then set A"? Maybe you
could argue that they aren't operationally equivalent, but can you
guarantee
But IO actions *are* pure values. What side effects do they have? None! You
can do whatever you want with them with no harmful effects in any Haskell
expression. They only special thing about them is that they have a run
function that is not itself provided in Haskell. The run function is
actually
The type looks similar to the denotation for sets, but implementing a
covariant interface for it would not be straightforward and may also be
inefficient.
On Apr 16, 2013 11:17 AM, "Alejandro Serrano Mena"
wrote:
> Hi,
> First of all, let me say that this work on matchers is really useful :)
>
>
I have a trick that loses a little convenience, but may still be more
convenient than data families.
{-# LANGUAGE TypeFamilies #-}
import Data.Tagged
type family F a
foo :: Tagged a (F a)
foo = Tagged undefined
bar :: Tagged a (F a)
bar = foo
This allows you to use the same newtype wrapper c
I won't compare and contrast all these, but I want to point out that there
is a nicer version of uniplate in the lens package.
On Dec 17, 2012 5:31 AM, "Ravi Sahni" wrote:
> Clearly Haskell has great possibilities in the field of
> language-processing. And the nuisances associated with little ac
I once had a problem like this. It turned out that my laptop was stepping
the cpu clock rate down whenever it got warm. Disabling that feature in my
BIOS fixed it. Your problem might be similar.
On Nov 27, 2012 7:23 AM, "Janek S." wrote:
> I tested the same code on my second machine - Debian Sque
I stick to 80 columns fairly rigidly. This is not only so that it fits
into narrow windows, but also so that any two subexpressions in the
same expression tend to be close together on my screen, which makes it
easier for me to reason about it. If only it was easy for me to read
and write code on a
I golfed a bit. :)
sequence <=< filterM (const [False ..])
On Thu, Oct 25, 2012 at 6:11 PM, dokondr wrote:
>
> On Fri, Oct 26, 2012 Alex Stangl wrote:
>
>>
>> combos [] = [[]]
>> combos ([]:ls) = combos ls
>> combos ((h:t):ls) = map (h:) (combos ls) ++ combos (t:ls)
>>
>
> Excellent, thanks!
On Mon, Oct 15, 2012 at 11:29 PM, Dan Doel wrote:
> I'm uncertain where this, "compositional means written as the
> composition of functions," thing started. But it is not what I, and
> I'm sure any others mean by the term, "compositional."
You're right. It's a rather recent, as far as I can tell
On Mon, Oct 15, 2012 at 11:33 AM, Jake McArthur wrote:
> On Mon, Oct 15, 2012 at 7:59 AM, Ertugrul Söylemez wrote:
>> Try to express
>>
>> do x <- getLine
>>y <- getLine
>>print (x, y)
>>
>> using only Kleisli composition (w
On Mon, Oct 15, 2012 at 7:59 AM, Ertugrul Söylemez wrote:
> Try to express
>
> do x <- getLine
>y <- getLine
>print (x, y)
>
> using only Kleisli composition (without cheating).
In my opinion, this is not as nice as the do-notation version, but at
least it's compositional:
You do not have to use computeIntoP. You can just use computeP followed by
toForeignPtr (i don't remember the exact name for that and am on my phone
so it would be awkward to look up). So Repa can create the buffer for you.
Coincidentally, I didn't realize computeIntoP even existed, and I want it
f
On Sep 30, 2012 10:56 AM, "Albert Y. C. Lai" wrote:
>
> On 12-09-29 09:57 PM, Vasili I. Galchin wrote:
>>
>> I would an examples of monads that are pure, i.e. no
side-effects.
>
>
> What does "side effect" mean, to you? Definition?
When discussing monads, at least, a side effect is an ef
9/18 Alberto G. Corona :
>
>> Hi Jake
>>
>> I don´t know what you mean with multiple tabs. The user management is
>> simple, anonymous clients are identified with a cookie. if the user
>> is logged (MFlow has widgets for logging-validation) the user is the
>>
In fact, unboxed arrays of tuples are represented in vector as tuples of
unboxed arrays.
On Aug 9, 2012 4:35 AM, "Ketil Malde" wrote:
> David Feuer writes:
>
> > So I was thinking about a mutable array of tuples, but to avoid
> allocating
> > tuples to modify their fields, I guess I really want
I feel like this thread is kind of surreal. Knight Capital's mistake
was to use imperative programming styles? An entire industry is
suffering because they haven't universally applied category theory to
software engineering and live systems? Am I just a victim of a small
troll/joke?
- Jake
On Sat
Have you already verified that stream fusion won't just do this for you?
On May 23, 2012 12:35 AM, "Evan Laforge" wrote:
> So I wanted to find the first index in a vector whose running sum is
> greater than a given number.
>
> The straightforward way is to create the running sum and then search:
I once experimented with something similar. This is a preprocessor.
This was a long time ago, and I don't use it.
https://patch-tag.com/r/jmcarthur/overloaded-whitespace/snapshot/current/content/pretty/Main.hs
On Thu, Apr 19, 2012 at 8:40 AM, Ismael Figueroa Palet
wrote:
> Hi Michael!
>
> Thanks
te:
> On 3/26/12 8:16 AM, Jake McArthur wrote:
>
>> This is interesting because it seems to be a counterexample to the claim
>> that you can lift any Num through an Applicative (ZipList, in this case).
>> It seems like maybe that only works in general for monoids instead of
This is interesting because it seems to be a counterexample to the claim
that you can lift any Num through an Applicative (ZipList, in this case).
It seems like maybe that only works in general for monoids instead of rings?
On Mar 25, 2012 8:43 PM, "Chris Smith" wrote:
> Jerzy Karczmarczuk wrote
This mailing list is not Twitter. Please stop sending emails without
meaningful content.
On Mar 17, 2012 12:42 PM, "KC" wrote:
>
>
> --
> --
> Regards,
> KC
>
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/
Just a little more interesting information: This is why impure languages
like OCaml have the value restriction. Haskell doesn't need it because it
is pure, but of course unsafePerformIO thwarts that.
On Mar 15, 2012 1:34 PM, "Tillmann Rendel"
wrote:
> Hi,
>
> this is one of the reasons why unsafe
My understanding was that the reason is that CSE can cause things to be
shared that take up a lot of space when normally they would be garbage
collected sooner.
On Feb 18, 2012 11:57 AM, "Roman Cheplyaka" wrote:
> It doesn't matter. Laziness would be affected if, for instance,
> something is not
First, see this question about space usage on Stack Overflow:
http://stackoverflow.com/questions/3254758/memory-footprint-of-haskell-data-types
Next, apply this knowledge not only to Ints, but also to tuples and
lists. There's your memory usage.
- Jake
On Wed, Feb 1, 2012 at 10:29 AM, Johan Bri
On Mon, Jan 23, 2012 at 10:45 AM, David Barbour wrote:
> the repeated failures of attempting to model stream processing with infinite
> lists,
I'm curious about what failures you're talking about.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@hask
On Dec 9, 2011 4:48 PM, "Stephen Tetley" wrote:
> For the specific problem of OpenGL - as the package already exists I'm
> not sure a generative approach would actually pay its way
I strongly disagree. OpenGLRaw is in pretty bad shape right now. It's not
up to date with the OpenGL spec and is ver
On Thu, Oct 13, 2011 at 3:32 PM, Yves Parès wrote:
>> The number of new cons cells created in due course is Θ(length xs). These
>> cons cells would not have been created if we printed length xs and printed
>> length ys separately.
> Okay, so the major problem comes from memory management.
Well, i
On Oct 9, 2011 11:17 PM, "David Barbour" wrote:
> If you really want the input type to be part of the Filter type
definition, you'll need to use arrows instead of monads.
I wouldn't say that. You just need an extra type parameter. That doesn't
mean it can't be a monad. In fact, wrapping ReaderT a
On Thu, Sep 22, 2011 at 7:02 PM, Richard O'Keefe wrote:
>
> On 21/09/2011, at 11:42 PM, Jake McArthur wrote:
>> With fixed point numbers, it makes sense to have an Enum instance.
>
> What is the use case?
I'm not quite sure how to answer this. I'm speaking in a
I think this proposal makes so much sense that I'm surprised it didn't
already work this way.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Tue, Sep 20, 2011 at 11:29 PM, Richard O'Keefe wrote:
>
> On 21/09/2011, at 2:59 AM, Chris Smith wrote:
>
>> On Mon, 2011-09-19 at 22:09 -0700, Evan Laforge wrote:
>>> Then I tried switching to a fixed point format, and discovered my
>>> mistake. Enum is supposed to enumerate every value betwe
On Tue, Sep 20, 2011 at 3:48 PM, Chris Smith wrote:
> But it would be the *wrong* thing to use as a desugaring for list range
> notation. List ranges are very unlikely to be useful or even meaningful
> for most such enumerations (what is [ Red, Green .. LightPurple]?); and
> conversely, as we've
On Tue, Sep 20, 2011 at 10:59 AM, Chris Smith wrote:
> The better way to look at this is that the notion of `succ` and `pred`
> is dependent on the type, much like `mappend` has no particular meaning
> until a Monoid instance is given for the type. It's fairly well
> established, though undocumen
On Tue, Sep 20, 2011 at 10:59 AM, Chris Smith wrote:
> I certainly hope not. Instead, perhaps the issue should be brought up
> with the fixed-point number library you're using, and they could fix
> their Enum instance to be more helpful.
I'm the author of the library in question. I intentionally
Translation from c is much more straightforward with openglraw compared with
OpenGL. Also, many of the design decisions behind OpenGL are arbitrary or
limiting, and some features aren't even exposed in its interface.
___
Haskell-Cafe mailing list
Haskell-
I highly recommend that you check out #haskell on freenode. In my opinion
its the best channel on freenode, and there are always tons of helpful
people and a lot of stimulating conversation. Hope to see you there!
___
Haskell-Cafe mailing list
Haskell-Caf
On Thu, Apr 21, 2011 at 7:31 PM, Maciej Marcin Piechotka
wrote:
> Last time I checked it disallowed my as 5 depended on 4 which depended
> on 3 which depended on 2 which depended on 1 as all changed x.hs
Merely changing the same file is not sufficient for that. In order for
Darcs to say patch A d
rything is ok.
% darcs unrec -a -p 'Fix to feature X'
Finished unrecording.
% darcs amend -a -p 'Feature X'
Thu Apr 21 19:11:54 CDT 2011 Jake McArthur
* Feature X
Shall I amend this patch? [yN...], or ? for more options: y
Finished amending patch:
Thu Apr 21 19:14:41 CDT
You can think of IO actions as values (which don't change)
representing imperative programs to execute (which may have different
results each time you execute them). So, `fa fb fc` represents the
exact same value as `fa fb fc`, but if you execute that value multiple
times you may get different resu
I share your dream of being able to write high-level code for soft real
time software, so while I'm not interested in working on your project
directly at this time, it's still in my best interest for it to be
successful.
My only question is this: what does your language offer that others do
n
On 03/23/2011 10:34 AM, Ketil Malde wrote:
It works (calling the same function) from GHCi, but breaks when
compiled. Also when compiling with -O0.
Confirmed for GHC 7.0.2. Works fine in GHCi, but compiling it (in my
case, with -O) and running the executable causes a stack overflow unless
I r
Try `return x = MyST (return x)`. It's (.) that throws it off.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 02/12/2011 02:22 PM, Christopher Done wrote:
IRC channel has 600~ users in at any one time.
At this moment it has 720! And this seems to be roughly the norm recently.
- Jake McArthur
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
On 02/03/2011 03:10 PM, Andrew Coppin wrote:
(Unless you're seriously going to suggest that GHC's native code
generator is any match for the might of a half-decent C compiler...)
I don't know enough about the native code generator to make a claim like
that, but we're not comparing the native c
So everybody doesn't have to go watch it, here is a shortened version of
what Steele said in the video:
Although Fortress is originally designed as an object-oriented framework in
which to build an array-style scientific programming language, [...] as we've
experimented with it and tried to g
On 01/05/2011 03:44 AM, Jonathan Geddes wrote:
When I write Haskell code, I write functions (and monadic actions)
that are either a) so trivial that writing any kind of unit/property
test seems silly, or are b) composed of other trivial functions using
equally-trivial combinators.
"There are tw
omMaybe
instance FromMaybe String where
type Maybe' String = Maybe String
fromMaybe = Data.Maybe.fromMaybe
instance (FromMaybe a, FromMaybe b) => FromMaybe (a, b) where
type Maybe' (a, b) = (Maybe' a, Maybe' b)
fromMaybe (x, y) (a, b) = (fr
I am no decision maker regarding Hackage, but I would like to echo my
support for this offer. Hackage is a vital part of my workflow, and I'm
sure I'm not the only one. Its importance to the Haskell community has
grown quickly and is continuing to do so. Each time it goes down, the
impact is la
On 11/19/2010 05:24 PM, Gregory Propf wrote:
I was hoping to play around with Data.Parallel.Haskell (dph) but noticed
that it seems to have been exiled from ghc 7.0.1 which I just installed.
It also doesn't seem to be in cabal. Anybody know how to use dph with
7.0.1 or has it been abandoned or so
On 11/17/2010 09:56 PM, Daniel Santa Cruz wrote:
Curious about the most active members of the #haskell IRC channel? Out
of around 28K "utterances" in the channel this week, 24% of them where
spoken by the top 5 most active members. Not suprisingly, the dear
lambdabot is at the top
What you describe sounds like a perfect job for a trie, so that's what I
think you should look into.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 10/08/2010 04:23 PM, Alex Rozenshteyn wrote:
Does there exist a library which allows me to have maps whose elements
are maps whose elements ... with a convenient syntax.
It sounds like you might be looking for a trie of some sort. Would
something like the TrieMap package suit your needs? It
On 09/18/2010 02:51 AM, Christopher Tauss wrote:
I am trying to write a function that takes a list and returns the last n
elements.
This may just be for the sake of learning, in which case this is fine,
but usually, needing to do this would be a sign that you are using lists
improperly (sinc
Just wanted to let everybody know that there is an AI contest [1] that
started today. Everybody has about two months to create bots that
compete against each other 1-on-1 in a game based on Galcon [2].
A couple issues to mention for full disclosure: There is some
sponsorship by Google, but unf
On 07/18/2010 08:27 AM, Ivan Lazar Miljenovic wrote:
When discussing a similar issue with Manuel Chakravarty, he convinced me
that cunning newtype deriving is actually rather bad in practice and
shouldn't be used as there's a lack of proofs or some such (I can't
remember the arguments, but I reme
On 07/15/2010 05:33 PM, Victor Gorokhov wrote:
Thanks for an example! Probably, one can think about using Arrays
instead of Map or IntMap in order to achieve 'true' O(1) in pure. But
I suppose that there are some trouble with array expanding. Or
somebody would already make it.
Pure arrays hav
On 07/15/2010 02:30 AM, Stephen Tetley wrote:
2010/7/15 Jake McArthur:
On 07/14/2010 05:01 PM, Victor Gorokhov wrote:
You can implement pure pointers on top of Data.Map with O(log n) time
Or on top of Data.IntMap with O(1) time. ;)
Unlikely...
From the docs, lookup is O(min(n,W
On 07/14/2010 05:01 PM, Victor Gorokhov wrote:
You can implement pure pointers on top of Data.Map with O(log n) time
Or on top of Data.IntMap with O(1) time. ;)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/list
On 07/05/2010 04:48 PM, Yves Parès wrote:
3) Is there another library on hackage that handles images in a
functional way? (I mean not /all in IO/)
Check out graphics-drawingcombinators.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
ht
On Sun, Jun 27, 2010 at 4:44 PM, Alexey Khudyakov
wrote:
> Dependent types would be nice but there isn't anything usable out there.
> Newtype wrapper parametrized by type level number works fine so far.
>
> If you interested sources are available here:
> http://bitbucket.org/Shimuuar/nvector
> htt
Sorry, I hit Reply instead of Reply To All.
-- Forwarded message --
From: Jake McArthur
Date: Tue, Jun 8, 2010 at 6:16 PM
Subject: Re: [Haskell-cafe] Rewriting a famous library and using the
same name: pros and cons
To: Don Stewart
Making a new name for an existing package
On 06/03/2010 10:14 AM, Gabriel Riba wrote:
No need for runtime errors or exception control
hd :: List!Cons a -> a
hd (Cons x _) = x
This is already doable using GADTs:
data Z
data S n
data List a n where
Nil :: List a Z
Cons :: a -> List a n -> List a (S n)
On 05/23/2010 02:17 PM, Peter Verswyvelen wrote:
IMO: For AAA game programming? Definitely not.
Why not? I suppose it may depend on your definition of "AAA," since
there doesn't seem to be any consensus on it. I have seen it mean
various combinations of the following, but rarely, if ever, all
On Tue, Apr 6, 2010 at 6:08 AM, Serguey Zefirov wrote:
> http://lambda-the-ultimate.org is one lovely community that has that
> restriction: http://lambda-the-ultimate.org/policies#Policies
I quote the policy in full here:
> Many of us here post with our real, full names. Anonymity and the use o
On 04/05/2010 11:32 PM, Ivan Miljenovic wrote:
4) The people who support the policy don't see why anyone has a problem with it.
I have seen no logical explanation of *why* anybody supports this
policy. I've only seen vague hand-wavy statements like "people who use
real names are more reliable
On 04/04/2010 06:35 PM, Ivan Miljenovic wrote:
I would wonder _why_ anyone would refuse to do so. Are they that
ashamed of their own software that they wouldn't want to be associated
with it, or is there some legal reason that they don't want to be
associated with it?
This seems to be orthogon
Here's a transcript from a conversation I had with Conal on IRC.
tl;dr: cross-module inlining is only possible because ghc
stashes a definition in a .hi, iuuc. i'm suggesting that the stashed
definition either (a) never include further inlinings, or (b) be
augmented by such a definition.
Full t
I've run into an issue with inlining that I'm not sure how to work
around. I am instantiating some pre-existing type classes with
Vector-based types. There already exist generic functions in modules I
do not control that use this type class, and they are not tagged with
the INLINE pragma. I am
Maurício CA wrote:
I believe I forgot to write a section with that information, as
well as others one would like to know from start. I wrote a new
section trying to fix that in 'how to use it' topic.
http://bitbucket.org/mauricio/bindings-dsl/wiki/HowToUseIt
Very nice. I think that is clear e
Maurício CA wrote:
> My only complaint is that the macros get confused if you use a
> Haskell type that has a single quote in it.
Can you give me an example?
It turns out that I read the documentation incorrectly, but here is what
I was trying to do.
I had two structs, one of which used
I did not notice when this was released, but I saw it on Hackage
yesterday and, with it, wrote some of the easiest bindings to a fairly
complex C API I've written in a while. This package is excellent! Thank
you for sharing it.
My only complaint is that the macros get confused if you use a Has
Shae Errisson, myself, Greg Bacon, and some other locals who I think
might not have as big a presence online are starting a user's group in
Huntsville, AL. Please join the Google group / mailing list [1] if you
are interested!
[1] http://groups.google.com/group/alabamahaskell
- Jake McA
Nothing by itself. It's just a definable constructor of some sort.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Martijn van Steenbergen wrote:
It doesn't work for this one:
newtype Split a = Split { runSplit :: [Either a (Char, Split a) ]}
But my handwritten instance remains identical.
The instance has the form [], not the form [Either _ (Char, Split _)].
Since they don't match exactly, it won't giv
Tobias Bexelius wrote:
I've put a simple GPipe example (including a screenshot) on the
haskellwiki now, showing off an animated spinning box.
Nice to see Data.Vec.LinAlg.Transform3D! That will be a big help. I'm
having fun with GPipe. Thanks for the library!
- Jake
__
If you could throw it on Hackage or a public repo you will get more
exposure. :)
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Günther Schmidt wrote:
And that I find to be the really tricky part, how do I *design* a DSL?
My favorite approach is something like as described in these:
http://lukepalmer.wordpress.com/2008/07/18/semantic-design/
http://conal.net/papers/type-class-morphisms/
It takes a little bit of ti
staafmeister wrote:
Yes I know but there are a lot of problems requiring O(1) array updates
so then you are stuck with IO again
Or use ST. Or use IntMap (which is O(log n), but n is going to max out
on the integer size for your architecture, so it's really just O(32) or
O(64), which is really
I forgot to also mention this somewhat recent announcement for a
pedantically type safe HTML library:
http://www.haskell.org/pipermail/haskell-cafe/2009-August/064907.html
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskel
Colin Paul Adams wrote:
One problem will be to get GHC ported to DragonFly BSD, but that can
wait until I have a test version of the site working on Linux.
I would love to see this. It's the biggest thing blocking me from trying
Dragonfly more seriously.
WASH attracts me, with it's guarante
John Lato wrote:
This looks to be essentially the same as the 'map' function in
ListLike, and suffers from the same problem. It won't have the
performance characteristics of the native map functions. Using e.g.
ByteStrings, you're recreating a ByteString by snoc'ing elements.
Oh, I see now wh
Jake McArthur wrote:
The monoids package offers something similar to this:
mapReduce :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> m
If we take (Elem c) to be (item), (e) to be (item'), (c) to be (full),
and (m) to be (full'), it's basically the same
The monoids package offers something similar to this:
mapReduce :: (Generator c, Reducer e m) => (Elem c -> e) -> c -> m
If we take (Elem c) to be (item), (e) to be (item'), (c) to be (full),
and (m) to be (full'), it's basically the same thing, and offers the
same advantages as the ones y
Job Vranish wrote:
What I am trying to do is hyper unusual and I really do need an
unsafeHorribleThings to do it.
Normally when I really, honestly think this, I'm wrong anyway.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.
Don Stewart wrote:
leaveye.guo:
Hi haskellers:
There is a mistake in http://www.haskell.org/haskellwiki/State_Monad
It post two functions like this :
evalState :: State s a -> s -> a
evalState act = fst $ runState act
execState :: State s a -> s -> s
execState act = snd $ runState ac
Actually, how about this?
import Data.Tree
newtype Task = Task (Tree (String, Bool))
Now you already have that tree structure you wanted.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/has
Iain Barnett wrote:
data Task = Task { title :: String, completed :: Bool, subtasks :: [Task] }
This one looks the best to me. Remember, you can just use an empty list
if the task has no subtasks.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@h
I think there are some basic equivalents in the TypeCompose and
category-extras packages, for the record, but a standalone version
wouldn't hurt either!
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listi
Michael Vanier wrote:
Haskell is a wonderful language (my favorite language by far) but it is
pretty difficult for a beginner. In fact, it is pretty difficult for
anyone to learn in my experience, because it has so many advanced
concepts that simply don't exist in other languages, and trying t
Linker wrote:
Hugs> [0,0.1..1]
[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]
>
Prelude> [0,0.1..1]
[0.0,0.1,0.2,0.30004,0.4,0.5,0.6,0.7,0.7999,0.8999,0.]
Just floating point errors. In this case, you may be able to get away
with something l
Paulo J. Matos wrote:
As you can see, I had just finished installing alex 2.3.1, so why does
cabal still request alex >=2.0.1 && <3?
Probably you don't have alex in your PATH.
- Jake
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.h
Hans van Thiel wrote:
Just to show I'm paying attention, there's an arrow missing, right?
(.) ::(b -> c) -> (a -> b) -> (a -> c)
Correct. I noticed that after I sent it but I figured that it would be
noticed.
I also used (>>>) where I meant (>=>) at the bottom. The
Jake McArthur wrote:
Generally, you can transform anything of the form:
baz x1 = a =<< b =<< ... =<< z x1
into:
baz = a <=< b <=< ... <=< z
I was just looking through the source for the recently announced Hyena
library and decided to give a mor
Hans van Thiel wrote:
The only place I've ever seen Kleisli composition, or its flip, used is
in demonstrating the monad laws. Yet it is so elegant and, even having
its own name, it must have some practical use. Do you, or anybody else,
have some pointers?
I only just started finding places to
Jon Strait wrote:
I'm reading the third (bind associativity) law for monads in this form:
m >>= (\x -> k x >>= h) = (m >>= k) >>= h
Arguably, that law would be better stated as:
(h <=< k) <=< m = h <=< (k <=< m)
This wouldn't be so unintuitive.
- Jake
___
Rouan van Dalen wrote:
It is important to store only a reference to the parent and not a copy of the
entire parent for efficiency.
Others have already recommended the rosezipper package, which gives you
what you want, but I want to address one thing.
foo =
bar = foo
In most implem
Keith Sheppard wrote:
Is there any reason that sum isn't strict? I can't think of any case
where that is a good thing.
Prelude> sum [0 .. 100]
*** Exception: stack overflow
As others have said, there are cases where non-strictness is what you
want. And if you are using a type that is stri
Günther Schmidt wrote:
data Container a = Single a | Many a [a]
but the problem above is that the data structure would allow to
construct a Many 5 [] :: Container Int.
I think you meant to do either
data Container a = Single a | Many a (Container a)
or
data Container a = Con
1 - 100 of 216 matches
Mail list logo