On 25/05/11 10:00, Jonas Almström Duregård wrote:
As an equivalent to:
f (x a) (y b) (z c)
Of course my intention is that the new keyword should initiate layout
syntax so we can write this:
f applied to
x a
y b
z c
Here's a (tongue-in-cheek) trick that allows for layout close to
On 17/05/11 01:42, Michael Serra wrote:
eventLoop w cs = do
drawCells w cs
e - waitEventBlocking
checkEvent e
where
checkEvent (KeyUp (Keysym SDLK_ESCAPE _ _)) = return ()
checkEvent (KeyUp (Keysym SDLK_n _ _)) = eventLoop w $
nextgen cs
checkEvent _
On 14/04/11 13:00, Chris Dew wrote:
class Stream a b c d where
(-) :: a - (b - c) - d
instance Stream (IO d) d (IO c) (IO c) where
f - g = f= g
instance Stream d d (IO c) (IO c) where
f - g = g f
instance Stream d d c c where
x - y = y $ x
I notice that in all
On 31/03/11 11:03, Gregory Collins wrote:
I'm guessing the trigger condition for
BlockedIndefinitelyOnMVar is blocked and mvar refcount == 1
It's not simply a reference count (the thread that's blocked forever can
hold multiple references to the MVar and it's still blocked
indefinitely).
On 09/02/11 15:34, Krzysztof Skrzętnicki wrote:
Hello Cafe,
Here is a simple program that yields strange results:
module Main where
import Control.Concurrent
import Control.Concurrent.Chan
import Control.Monad
main = do
c - newChan
writeChan c 1
forkIO $ forever $ do
i - readChan c
Hi,
First of all, don't be fooled by the alloc statistic. That is not 3GB
memory residency, that's 3GB allocation, which was interspersed with
lots of garbage collections, in the same way that measuring how many
times malloc was called in a C program doesn't necessarily indicate
memory
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
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
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 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
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 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 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 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 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 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 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
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 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
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 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 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 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 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 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 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
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 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 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 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 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
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 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
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
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
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
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
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
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
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
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
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 (
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 $
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
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,
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
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,
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
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 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
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
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
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?
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
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
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
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 =
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
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
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
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
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
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
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
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,
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
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
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
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,
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 =
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
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
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
Hi,
In my CHP library I need to do some exception catching. I want the
library to work on GHC 6.8 (with base-3 -- this is the current version
in Ubuntu Hardy and Jaunty, for example) and GHC 6.10 (which comes with
base-4). But base-3 and base-4 need different code for exception
catching
Hi,
One reason (there may be more) is as follows:
Grigory Sarnitskiy wrote:
class Configuration c where
getParticleI :: (Particle p) = c - Int - p
This type signature declares that for any type c that has a
Configuration instance (and an Int), you can give me back something that
is of
CK Kashyap wrote:
Hi All,
I am working on a diagraming utility in Haskell. I started with line
drawing.
I am doing the basic stuff using the y = mx + c formula to draw a line
between (x1,y1) and (x2,y2)
Hi,
Are you doing this to learn Haskell, learn about drawing lines, or to
just get it
Jules Bean wrote:
I've been using GHC for years and my honest opinion is that the
warnings very rarely flag an actual maintainability problem in the
code I write, and very frequently annoying highlight something I knew
I was doing, and did quite deliberately - most often inexhaustive
patterns
Leonard Siebeneicher wrote:
Dear reader,
I wonder whether there is a 'general' working solution to include files
within a parsec parser. Without the need of unsafePerformIO.
At least in parsec 2, I don't think so. Our solution was to read in the
main file, tokenise it (using Alex),
Clicking on the source code link reveals that enum2 is used in the where
clause. It's not important to the transformation that Jake was performing.
In essence, = is the monadic version of . (function composition) and
as explained, it can be used to do some pointfree-like programming in
the
1 - 100 of 118 matches
Mail list logo