Colin Paul Adams wrote:
I'm getting these errors (ghc 6.10.4 on Linux x86_64):
Building chp-plus-1.1.0...
[1 of 9] Compiling Control.Concurrent.CHP.Test (
Control/Concurrent/CHP/Test.hs, dist/build/Control/Concurrent/CHP/Test.o )
[2 of 9] Compiling Control.Concurrent.CHP.Console (
Neil Brown wrote:
Colin Paul Adams wrote:
I'm getting these errors (ghc 6.10.4 on Linux x86_64):
Building chp-plus-1.1.0...
[1 of 9] Compiling Control.Concurrent.CHP.Test (
Control/Concurrent/CHP/Test.hs,
dist/build/Control/Concurrent/CHP/Test.o )
[2 of 9] Compiling
Thomas Schilling wrote:
Here's a matching Wiki style: http://i.imgur.com/XkuzH.png
I like your designs (I liked the blue and orange version, but all the
colour schemes seem fine).
For the wiki design, it would be good to re-think and cull those links
at the top of the page. For
Ivan Lazar Miljenovic wrote:
As of 6.12.1, the new -fwarn-unused-do-bind warning is activated with
-Wall. This is based off a bug report by Neil Mitchell:
http://hackage.haskell.org/trac/ghc/ticket/3263 .
However, does it make sense for this to be turned on with -Wall? For
starters, why
Jason Dagit wrote:
On Wed, Apr 14, 2010 at 3:13 PM, Daniel Fischer
daniel.is.fisc...@web.de mailto:daniel.is.fisc...@web.de wrote:
Am Mittwoch 14 April 2010 23:49:43 schrieb Jason Dagit:
It will be interesting to hear what fixes this!
forever' m = do _ - m
Hi,
This is quite a neat generalisation of forkIO, and something I've wanted
in the past.
My comment would be about the MonadIO m requirement for ForkableMonad.
I understand that conceptually it's a nice thing to have. But
practically, I don't think it's necessary, and could be a little
Hi,
Primarily I want to see in FGL: documentation, documentation and more
documentation. The library has lots of undocumented functions
(especially the queries, e.g.
http://hackage.haskell.org/packages/archive/fgl/5.4.2.2/doc/html/Data-Graph-Inductive-Query-DFS.html
has no documentation at
Bjorn Buckwalter wrote:
Dear all,
Does it make good sense that 'and []' returns 'True' and 'or []'
returns 'False'?
It's certainly what I would expect it to do, based on several ways of
thinking.
1: If we define the function using explicit recursion:
and (x:xs) = x and xs
Therefore and []
Hi,
The issue of a tool to help with checking packages against the Package
Versioning Policy (PVP:
http://www.haskell.org/haskellwiki/Package_versioning_policy) has come
up several times on this list, and it seems to be a generally wanted
tool. One of the things desired in such a tool is
Bill Atkins wrote:
Almost - liftM modificationTime has type Status - IO EpochTime.
Like other IO functions (getLine, putStrLn), it returns an IO action
but accepts a pure value (the modification time)
Also, I like this style:
import Control.Applicative (($))
blah = do
times - mapM
On 25/05/10 12:36, Ionut G. Stan wrote:
Hi,
I'm doing TDD in pretty much all of the languages that I know, and I
want to introduce it early in my Haskell learning process. I wonder
though, if there's some established process regarding TDD, not unit
testing.
I've heard of QuickCheck and
On 14/06/10 06:42, Aran Donohue wrote:
Hi Cafe,
I've been doing Haskell for a few months, and I've written some
mid-sized programs and many small ones. I've read lots of
documentation and many papers, but I'm having difficulty making the
jump into some of the advanced concepts I've read
Hi,
Here's my guess. Take a look at this version, and try running it:
===
{-# LANGUAGE PackageImports #-}
import qualified MonadCatchIO-transformers Control.Monad.CatchIO as C
import Control.Monad.IO.Class
import Control.Monad.Trans.Cont
bracket_' :: C.MonadCatchIO m
= m a -- ^
On 23/06/10 06:54, Christopher Done wrote:
I'm not sure how Alternative differs from MonadPlus, other than being
defined for Applicative rather than Monad. They have the same laws
(identity and associativity).
Importantly, MonadPlus must satisfy some laws for (=) and (),
whereas
On 28/06/2010 20:02, Carl Howells wrote:
While working this weekend on the Snap web framework, I ran into a
problem. Snap implements MonadCatchIO, so I thought I could just use
bracket to handle resource acquisition/release in a safe manner.
Imagine my surprise when bracket simply failed to run
On 01/07/10 10:19, Tom Doris wrote:
According to the criterion.cabal file shipped with the latest
(0.5.0.1) version of criterion, the Chart package is broken under GHC
6.12:
flag Chart
description: enable use of the Chart package
-- Broken under GHC 6.12 so far
Does anyone know the
On 01/07/10 12:37, Patrick Browne wrote:
Why do some cases such as 1) fail to run even if they are the only
instantiation.
-- 1) Compiles but does not run
instance LocatedAt Int String where
spatialLocation(1)=home
That instance is fine. I presume the problem is that you are trying
On 01/07/10 13:11, Patrick Browne wrote:
Neil,
Does the following sum up the situation?
The class Num has subclasses containing various numeric types and the
literal 1 is a value for one or more of those types.
Hence the Haskell compiler says the instance 1) is OK.
But at run time, without the
On 02/07/2010 00:03, wren ng thornton wrote:
OS= OSX 10.5.8
GHC = 6.12.1
Cabal-Install = 0.8.2
Cabal = 1.8.0.2
$ cabal install criterion -fChart --reinstall
Resolving dependencies...
...
Configuring cairo-0.11.0...
setup: gtk2hsC2hs is required but it
On 08/07/10 09:08, Michael Mossey wrote:
data PlayState = PlayState
{ playState_cursor :: Int
, playState_verts :: [Loc]
, playState_len :: Int
, playState_doc :: MusDoc
}
Notice how often the characters
On 25/07/10 21:55, Yves Parès wrote:
Hello !
I've been studying Erlang and Scala, and I was wondering if someone
has already implemented an actors and message passing framework for
concurrent and distributed programs in Haskell.
Hi,
Take a look at the concurrency section on Hackage:
On 03/08/10 05:32, Gregory Crosswhite wrote:
I am pleased to announce the release of the package approximate-equality,
which provides newtype wrappers that allow one to effectively override the equality
operator of a value so that it is/approximate/ rather than/exact/. The wrappers use
type
Michael Mossey wrote:
If I have a list containing the arguments I want to give to a
function, is there a general way to supply those arguments in a
compact syntax?
In other words, I could have
args = [1,2,3]
f x y z = ...
I would write
t = f (args!!0) (args!!1) (args!!2)
but there may be
Bryan O'Sullivan wrote:
On Fri, Oct 9, 2009 at 8:33 AM, Jeremy Shaw jer...@n-heptane.com
mailto:jer...@n-heptane.com wrote:
What are the chances of seeing a, instance Data Text, some day?
I might as well follow up here, since I've sent Jeremy a couple of
messages on this subject.
I
Dan Piponi wrote:
On Mon, Oct 12, 2009 at 10:42 AM, muad muad.dib.sp...@gmail.com wrote:
Is it possible to prove correctness of a functions by testing it?
consider a function of signature
swap :: (a,b) - (b,a)
We don't need to test it at all, it can only do one thing, swap its
Hi,
I was thinking about some of my code today, and I realised that where I
have an arrow in my code, A b c, the type (A b) is also a functor. The
definition is (see
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Arrow.html):
fmap = (^)
-- Or, in long form:
fmap f x =
Hi,
We have names for properties of operators/functions. For example, if
this holds:
a % b = b % a
for some operator %, we say that % is commutative. Similarly, if this
holds:
(a % b) % c = a % (b % c)
we say that % is associative. Is there a name for this property, which
I'm
Hi,
Thanks for the replies so far. If it helps, after I sent my post, I
spotted a couple of arithmetic examples:
Neil Brown wrote:
2: (a % b) % c = (a % c) % b
Division (on rationals) obeys this property (a / b) / c = (a / c) / b --
which is actually equal to a / (b * c), but that doesn't
Andy Gimblett wrote:
Hi all,
I've been doing some GUI programming recently, using wx. To help
manage dependencies between state and UI elements, I looked for a
Haskell version of the Observer design pattern, and I found an
implementation written by Bastiaan Heeren of ou.nl [1].
Now,
Andy Gimblett wrote:
was a bit surprised at first that the observers were called
synchronously. Asynchronous is what I'd expect, and it's also
harder to code the asynchronous handlers wrongly. One blocking call
(such as putMVar) in a synchronous handler can screw up your whole
program by
Eugene Kirpichov wrote:
2009/11/12 Andrew Coppin andrewcop...@btinternet.com:
Even I am still not 100% sure how placing forall in different positions does
different things. But usually it's not something I need to worry about. :-)
To me it does not look like it does different things:
Jeremy O'Donoghue wrote:
Hi all,
I'm in the process of trying update the revisions of wx (part of
wxHaskell) on hackage.
I'm getting an error I find slightly surprising:
...
Library
if flag(splitBase)
build-depends: base = 3, wxcore = 0.12.1.1, stm
Change this last line to base
Michael Lesniak wrote:
Hello,
I'm currently developing some applications with explicit threading
using forkIO and have strange behaviour on my freshly installed Ubuntu
Karmic 9.10 (Kernel 2.6.31-14 SMP).
Setup:
Machine A: Quadcore, Ubuntu 9.04, Kernel 2.6.28-13 SMP
Machine B: AMD Opteron 875,
Michael Lesniak wrote:
Hello,
I've written a smaller example which reproduces the unusual behaviour.
Should I open a GHC-Ticket, too?
Hi,
I get these results:
$ time ./Temp +RTS -N1 -RTS 16
real0m16.010s
user0m10.869s
sys0m5.144s
$ time ./Temp +RTS -N2 -RTS 16
real
Michael Lesniak wrote:
Hello,
getTime? I wonder if that number might be causing the problem; can you
replicate it with lower sys times?
That was it! Thanks Neil!
When I'm using some number crunching without getTime it works (with
more or less the expected speedup and usage of two
Simon Peyton-Jones wrote:
| What's the status of the TDNR proposal [1]?
It's stalled. As far as I know, there's been very little discussion about it. It's not a trivial thing to implement, and it treads on delicate territory (how . is treated).
Having skimmed the page, it seems like the
Ozgur Akgun wrote:
Anyway, just forget the fact that these funstions do not do a check on
the length of the input list for a moment. My question is, how can I
generalize this function to accept a list of lists of arbitrary
length, and produce the required result.
Hi,
The concise solution is
It looks like a bug to me. Can you show an exact list of nodes and
edges that is causing mkGraph to fail? Or is that what you have
displayed, and I can't parse it properly?
Thanks,
Neil.
Ivan Lazar Miljenovic wrote:
When developing my QuickCheck-2 test-suite for graphviz, I wrote the
David Menendez wrote:
From what I can tell, insEdge inserts an edge between two nodes which
are already in the graph. The code is calling insEdge on
arbitrarily-labeled nodes, which may not exist in the graph.
That's what I thought initially, but in fact what it is doing is exactly
what you
Hi,
You want gmapT (or gmapM for the monadic version). If you look at the
source to the everywhere function, you'll see that everywhere is defined
in terms of gmapT:
everywhere f = f . gmapT (everywhere f)
Thanks,
Neil.
rodrigo.bonifacio wrote:
Hi all,
Is there a non-recursive
Sjoerd Visscher wrote:
In the case of Dual [1] `mappend` Dual [2] there's no need to do any
unwrapping. There is if you say:
l :: [Int]
l = Dual [1] `mappend` Dual [2]
The way I think this could work is that when the type checker detects a type
error, it will first try to resolve it by
wren ng thornton wrote:
Nicolas Pouillard wrote:
Excerpts from Heinrich Apfelmus's message of Tue Dec 01 11:29:24
+0100 2009:
For mnemonic value, we could call it a train:
data Train a b = Wagon a (Train a b)
| Loco b
I rather like it too. The mnemonic version sounds
Emmanuel CHANTREAU wrote:
Le Thu, 3 Dec 2009 13:20:31 +0100,
David Virebayre dav.vire+hask...@gmail.com a écrit :
It doesn't work this way : Strings are just lists of Chars. Comparison
is made recursively, Char by Char. You can have a look at the source
to make sure :
instance (Eq a) = Eq
Emmanuel CHANTREAU wrote:
I will take an example:
f x y= x+y
The program ask the user to enter two numbers and print the sum. If the
user enter 1 2 f 1 2=3 is stored and a gargage collector is used to
remove this dandling expression later ?
If the user enter again 1 2, ghc search in dandling
Patrick Caldon wrote:
I'm looking for the right concurrency library/semantics for what
should be a reasonably simple problem.
I have a little simulator:
runWorldSim :: MTGen - SimState - IO SimState
it takes about a second to run on a PC. It's functional except it
whacks the rng, which
Andrey Sisoyev wrote:
Hi everyone,
isEmptyTMVar :: TMVar a - STM Bool Source
Check whether a given TMVar is empty.
Notice that the boolean value returned is just a snapshot
of the state of the TMVar. By the time you get to react on its result,
the TMVar may have been filled (or
Hi,
Sorry for the slightly delayed reply -- I didn't have time to look
through all your code and understand it until just now. Your code has
one (no doubt frustratingly!) small problem, which is in the deadlocking
pipeline3:
Maciej Piechotka wrote:
pipeline3 :: CHP ()
pipeline3 =
Hi,
I've just released version 2.0.0 of the Communicating Haskell Processes
(CHP) message-passing concurrency library onto Hackage. The main change
from 1.x is that I have split the functionality into two libraries: the
core functionality remains in the chp package (now version 2.0.0), while
Ozgur Akgun wrote:
data NumHolder = forall a. Num a = NumHolder a
instance Show NumHolder where
show (NumHolder n) = show n
liftNum :: (Num a) = (a - a) - NumHolder - NumHolder
liftNum f (NumHolder c) = NumHolder (f c)
The problem here is that you declare that liftNum will work for any
Jeremy Shaw wrote:
Hello,
Would it be possible to get a Data instance for Data.Text.Text? This
would allow us to create a Serialize instance of Text for use with
happstack -- which would be extremely useful.
Last time this came up, I had a look at providing a Data instance for
Text, and I
Xingzhi Pan wrote:
On Tue, Jan 26, 2010 at 11:24 PM, Eduard Sergeev
eduard.serg...@gmail.com wrote:
Xingzhi Pan wrote:
The first argument to foldr is of type (a - b - a), which takes 2
arguments. But 'step' here is defined as a function taking 3
arguments. What am I missing here?
Brian Denheyer wrote:
On Tue, 26 Jan 2010 22:41:44 -0800
Thomas DuBuisson thomas.dubuis...@gmail.com wrote:
doEvent f usDelay = forkIO $
threadDelay usDelay
doEvent f usDelay
f
Are you sure that's right ? It seems to be a memory-gobbling
infinite loop...
Why
Hi,
I noticed this on another package recently. Turned out it's already
been reported as a haddock bug
(http://trac.haskell.org/haddock/ticket/128) and fixed. I guess this
will be sorted when the fixed version of haddock is used to re-generate
the docs.
Thanks,
Neil.
John Millikin
Hi all,
I've just uploaded the first release of Progression to Hackage.
Progression is a small library that pulls together several other
libraries and utilities (particularly Criterion) to support the
optimisation of Haskell programs.
To use it, you wrap up your benchmarks in a program
Don't you simply need to do what the error message says, and add (*in
the Executable section*, at the end of the file):
build-depends: SFML
?
Limestraël wrote:
I think I must be dumb or something.
I did my SFML.cabal exactly the way the packager of vty-ui did vty-ui.cabal,
and I still have
Hi,
I had a look at the code for Event (both versions) and Lock (but not the
others just yet) and it seemed fine. If you do lots of calls to
waitTimeout before a set you will accumulate old locks in the list, but
that won't cause any error that I can see, so it would only be a problem
in
Roel van Dijk wrote:
2010/2/16 Neil Brown nc...@kent.ac.uk:
I had a look at the code for Event (both versions) and Lock (but not the
others just yet) and it seemed fine. If you do lots of calls to waitTimeout
before a set you will accumulate old locks in the list, but that won't cause
any
Sean Leather wrote:
I find myself often writing this pattern:
someFun x y z = ...
fun y z = runFun $ someFun someDefault y z
or, alternatively:
fun y = runFun . someFun someDefault y
I very often write this too (wanting function composition, but with a
two-argument
Hi,
Your code forks off N threads to do HTTP response checking, then waits
for the reply (invokeThreads). Each thread (runHTTPThread) calls
curlGetResponse and *immediately* sends the answer back down the channel
to invokeThreads (checkAuthResponse) -- then waits for half a second
before
Andy Gimblett wrote:
1. break the line after do
(to avoid a layout change when change name or arguments of float' or
rename the variable e)
I'm not convinced by this; perhaps while editing the code it's useful,
but those changes don't happen very often, and when they do, any
half-decent
Hi,
I'm looking at benchmarking several different concurrency libraries
against each other. The benchmarks involve things like repeatedly
sending values between two threads. I'm likely to use Criterion for the
task.
However, one thing I've found is that the libraries have noticeably
Jesper Louis Andersen wrote:
On Thu, Mar 4, 2010 at 7:16 PM, Neil Brown nc...@kent.ac.uk wrote:
However, one thing I've found is that the libraries have noticeably
different behaviour in terms of the amount of garbage created.
In fact, CML relies on the garbage collector for some
Jesper Louis Andersen wrote:
On Thu, Mar 4, 2010 at 8:35 PM, Neil Brown nc...@kent.ac.uk wrote:
CML is indeed the library that has the most markedly different behaviour.
In Haskell, the CML package manages to produce timings like this for fairly
simple benchmarks:
%GC time 96.3
Simon Marlow wrote:
import Control.Concurrent
import Control.Concurrent.CML
import Control.Monad
main :: IO ()
main = do let numChoices = 2
cs - replicateM numChoices channel
mapM_ forkIO [replicateM_ (10 `div` numChoices) $ sync $ transmit
c () | c - cs]
replicateM_ 10 $ sync $
On 10/08/10 00:29, Pieter Laeremans wrote:
Hello,
I'm trying some haskell scripting. I'm writing a script to print some
information
from a zip archive. The zip-archive library does look nice but the
performance of zip-archive/lazy bytestring
doesn't seem to scale.
Executing :
On 17/08/10 17:13, Tilo Wiklund wrote:
On 24/07/2010, aditya siramaditya.si...@gmail.com wrote:
Perhaps I'm being unclear again. All I was trying to say was that:
liftM2 (-) [0,1] [2,3] /= liftM2 (-) [2,3] [0,1]
-deech
I'm sorry if I'm bumping an old thread, but why should liftM2 f
On 19/08/10 14:26, Ivan Lazar Miljenovic wrote:
,
| -- | Indicates what kind of value may be stored within a type. Once
| -- superclass constraints are available, the @v@ parameter will
| -- become an associated type.
| class Stores c v | c - v
|
| data family Constraints :: (* - *) -
On 02/09/10 17:10, Stephen Sinclair wrote:
On Thu, Sep 2, 2010 at 3:25 AM, Jan Christiansen
j...@informatik.uni-kiel.de wrote:
I prefer
False= _|_ = True
Sorry to go a bit off topic, but I find it funny that I never really
noticed you could perform less-than or greater-than
On 03/09/10 11:11, Henning Thielemann wrote:
Ivan Lazar Miljenovic schrieb:
On 3 September 2010 04:57, Arie Peterson ar...@xs4all.nl wrote:
On Thu, 2 Sep 2010 19:30:17 +0200, Daniel Fischer
daniel.is.fisc...@web.de wrote:
Why would one consider using Ord for Map an abuse?
A kludge, for
On 06/09/10 11:23, Johannes Waldmann wrote:
We have overloaded numerical literals (Num.fromInteger)
and we can overload string literals (IsString.fromString),
so how about using list syntax ( [], : )
for anything list-like (e.g., Data.Sequence)?
I would have thought you have two obvious
On 07/09/10 05:24, wren ng thornton wrote:
that other class would (most likely) be a subclass of pointed
functors. In
any case, it does mean there's something of a mismatch between
singleton vs
return/pure/point/unit.
Not quite sure what you mean by a mis-match
Of course, I'd expect
Hi,
I've just released version 1.1 of my game-probability library. It's
intended to be an easy way to investigate the probability of various
dice rolls and card draws (the latter is the new addition for the 1.1
release), using a Haskell library/EDSL. It has various examples in the
On 14/09/10 07:45, Arnaud Bailly wrote:
What surprised me is that I would expect the behaviour of the two
functions to be different:
- in doRunMvnInIO, I would expect stdout's content to be printed
before stderr, ie. the 2 threads are ordered because I call takeMVar
in between calls to forkIO
On 13/09/10 17:25, Maciej Piechotka wrote:
import Control.Exception
import Foreign
import Prelude hiding (catch)
data StrictMonad a = StrictMonad a deriving Show
instance Monad StrictMonad where
return x = unsafePerformIO $ do
(return $! x) `catch` \(SomeException _) - return x
On 15/09/10 10:13, Jeroen van Maanen wrote:
The past year I have been working on a port of my machine learning project
named LExAu from Java to Haskell. I'm still very glad I took the jump, because
the complexity curve appears to be log shaped rather than exp shaped. In one
year I almost got
On 22/09/10 11:22, C K Kashyap wrote:
Hey Michael,
I'd like to announce the first release of http-enumerator[1], an HTTP
client package with support for HTTPS connections. This release is
very experimental; bug reports and API feedback are very welcome.
This sounds nice (I'll
On 30/09/10 09:41, C K Kashyap wrote:
Hi All,
I was thinking about doing an EDSL for Makefile (as an exercise)
I put down my line of thought here -
http://hpaste.org/40233/haskell_makefile_edsl
I'd appreciate some feedback on the approach. Also, I wanted some idea
on how(in the current
On 05/10/10 07:52, Nicolas Wu wrote:
I'd prefer to see something like
\ 1 - f
| 2 - g
but I'm sure something could be worked out.
While I think the case of
is a good idea, multiple clauses in lambdas seems more canonical to
me.
Alternatively, we could abandon
On 06/10/10 11:00, C K Kashyap wrote:
My ultimate aim it to
write an EDSL for x86 - as in, describe a micro-kernel in haskell,
compiling and running which would generate C code ( not sure if it's
even possible - but I am really hopeful).
Have you seen Potential
On 22/10/10 09:23, André Batista Martins wrote:
Tks for the answer,
the data structure of Either is:
data Either a b = Left a | Right bderiving (Eq, Ord, Read,
Show)
one example of what i want convert is:
Left(Right(Left(Left(
Hi,
The problem here is that the
Hi,
On 22/10/10 14:58, Michael Litchard wrote:
main =
do
rsp- Network.Browser.browse $ do
setAllowRedirects True -- handle HTTP redirects
request $ getRequest http://google.com/;
fmap (take 100) (getResponseBody rsp)
but I got this
On 09/11/10 11:53, Neil Brown wrote:
XMLGenerator.lhs:64:16:
Overlapping instances for EmbedAsChild
(IdentityT IO) (XMLGenT m (XML m))
arising from a use of `asChild' at XMLGenerator.lhs:64:16-22
Matching instances:
instance [overlap ok] (XML m
I'm not sure whether to reply to the list(s) or the ticket; maybe if you
think my comments are valid they can be copied to the ticket. From
looking, it seems to me that you do have overlapping instances, and I
wonder if it's actually a 6.12 bug for accepting the code, not a 7 bug
for
Hi,
You have a problem with your function getPhi. It has type:
getPhi :: forall a e m. (MutableMatrix a e m, Typeable a, Typeable e,
Floating e, Ord e) = VarStateT m ()
where MutableMatrix is:
class (PrimMonad m) = MutableMatrix a e m | a - e m where
No matter how you call getPhi, you
On 10/11/10 12:36, Yves Parès wrote:
I think this idea is a stairway to duck typing.
I exagerate, of course, but here is my point:
It shouldn't be difficult to make a class:
class HasName a where
name :: a - String
For accessing parts of data structures that have the same type, I agree
On 15/11/10 15:23, Dmitry Astapov wrote:
== Dragonfly ==
http://www.dragonfly.co.nz/
Participants: Finlay Thompson, Edward Abraham
Cloudy Bayes: Hierarchical Bayesian modeling in Haskell
The Cloudy Bayes project aims to develop a fast Bayesian model
fitter that takes advantage of
On 11/01/11 23:19, Tim Baumgartner wrote:
Hi,
I'm having difficulties with this function I wrote:
iterateR :: (MonadRandom m) = (a - m a) - a - m [a]
iterateR g s = do
s' - g s
return (s:) `ap` iterateR g s'
I'm running the computation with evalRandIO and surprisingly the first
call of
On 12/01/11 15:53, Edward Z. Yang wrote:
These are interesting, opposed perspectives, and I suspect what would be
good is to treat both situations. I think perhaps what would be good
to put in the introduction is the conceptual model of MVars: that is,
take and put are the fundamental
Hi,
I have a Haskell problem that keeps cropping up and I wondered if there
was any solution/work-around/dirty-hack that could help. I keep wanting
to define class instances for things like Functor or Monad, but with
restrictions on the inner type. I'll explain with an example, because I
Bas van Gijzel wrote:
Hello everyone,
I'm doing a bachelor project focused on comparing parsers. One of the
parser libraries I'm using is Parsec (2) and I'm going to implement a
very small subset of haskell with it, with as most important feature
the off-side rule (indentation based parsing)
Martijn van Steenbergen wrote:
Hello,
Mr. McBride and mr. Paterson define in their Applicative paper:
data Except e a = OK a | Failed e
instance Monoid e = Applicative (Except e) where ...
Sometimes I'd still like to use = on Excepts but this feels wrong
somehow, because it doesn't use
Hi,
When we needed to do something similar with Parsec, we chose to pack the
relevant source position into the error string (you can just use
Show/Read, plus a special sequence of characters to indicate where the
position ends and the real error starts). We then unpack it outside
runParser
Itsme (Sophie) wrote:
I could not find any contact info for Brian O'Sullivan, Don Stewart,
or John
Goerzen on their book site. Any pointers to how I might locate any of
them
much appreciated.
Two of the three have posted to this list in the last 24 hours, so you
can take their email addresses
Neil Mitchell wrote:
I didn't at first, then I remembered:
1 + True
=
fromInteger 1 + True
And if we have Num for Bool, it type checks.
Does that also mean that you could write:
if 3 - 4 then ... else ... (= if (fromInteger 3 :: Bool) - (fromInteger
4 :: Bool) then ... else ...)
or
properly, the slight variation is actually a good test). What I would
like to know is are there any plans for GHC to incorporate
user-definable scheduler?
What exactly is it that you want from a user-definable scheduler? Do
you want co-operative scheduling in your program, or do you want
Hi,
(1+) :: Num a = a - a
For the bind operator, you need something of type a - Maybe b on the
RHS, not simply a - a. You want one of these instead:
fmap (1+) (Just 3)
liftM (1+) (Just 3)
Alternatively, you may find it useful to define something like:
(*) = flip liftM
so that you can
Sven Panne wrote:
Regarding Functor/Applicative: The obvious instances for e.g. a 2-dimensional
vertex are:
data Vertex2 a = Vertex2 a a
instance Functor Vertex2 where
fmap f (Vertex2 x y) = Vertex2 (f x) (f y)
instance Applicative Vertex2 where
pure a = Vertex2 a a
Sittampalam, Ganesh wrote:
We've discussed replacing it with transformers+monads-fd+an mtl
compatiblity layer on librar...@. Ross and I plan to propose doing this
for the second release of the platform - it's not fair to disrupt the
first release at this stage.
transformers+monads-fd is quite a
Michael P Mossey wrote:
I've got one of those algorithms which threatens to march off the
right edge (in the words of Goerzen et al). I need something like a
State or Maybe monad, but this is inside the IO monad. So I presume I
need StateT or MaybeT. However, I'm still (slowly) learning about
Duncan Coutts wrote:
What we're currently missing is a PVP checker: a tool to compare APIs of
package versions and check that it is following the PVP. Ideally, we
will have packages opt-in to follow the PVP for those packages that do
opt-in we have the PVP enforced on hackage using the checker
1 - 100 of 118 matches
Mail list logo