Fellow Haskellers,
Much attention has been paid over the years to the regrettable
omission of singleton tuples from Haskell.
I am pleased to announce OneTuple, a humble implementation of the
singleton tuple for Haskell. Now you can:
* Wrap a single value of any type in a OneTuple !
*
G'day all.
Quoting John Dorsey [EMAIL PROTECTED]:
Contributions are welcome. The project could use a tutorial, and a
decent test suite. Strict singleton tuples are planned for the next
version.
I hope it has a Monad instance.
But more to the point: Can it send email?
Cheers,
Andrew
On 10/2/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
G'day all.
Quoting John Dorsey [EMAIL PROTECTED]:
Contributions are welcome. The project could use a tutorial, and a
decent test suite. Strict singleton tuples are planned for the next
version.
I hope it has a Monad
| Unless you use a different compiler.
|
| Malcolm keeping the dream of multiple implementations alive
|
| And keep dividing our compiler teams' efforts, while
| single-implementation languages conquer :)
|
| Don thinking that compiler developer fragmentation doesn't help now the
On Thu, Oct 2, 2008 at 1:17 AM, Simon Brenner [EMAIL PROTECTED] wrote:
On 10/2/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
G'day all.
Quoting John Dorsey [EMAIL PROTECTED]:
Contributions are welcome. The project could use a tutorial, and a
decent test suite. Strict singleton tuples
Hmm, it looks like you forgot to write a Traversable instance. I don't believe:
sequenceA (OneTuple [1,2,3,4]) = _|_
is correct. Here is my contribution!
instance Traversable OneTuple where
sequenceA (OneTuple x) = fmap OneTuple x
Luke
On Thu, Oct 2, 2008 at 12:56 AM, John Dorsey
On Thu, 2 Oct 2008 02:56:08 -0400, John Dorsey [EMAIL PROTECTED]
wrote:
Fellow Haskellers,
Much attention has been paid over the years to the regrettable
omission of singleton tuples from Haskell.
I am pleased to announce OneTuple, a humble implementation of the
singleton tuple for Haskell.
The Wikipedia says:
For a finite set of points in the plane, each colored red or
blue,
there is a line that simultaneously bisects the red points and bisects
the blue points, that is, the number of red points on either side
of the
line is equal and the number of blue points on either side
Hello Don,
Thursday, October 2, 2008, 12:07:47 PM, you wrote:
Don, I usually agree with almost everything you say -- but not this!
and i usually answer only in those few cases when i disagree ;)
My point was really that investing the effort required to get nhc98 into
the shape that we could
On Thu, Oct 2, 2008 at 00:39, Bill [EMAIL PROTECTED] wrote:
On Wed, 2008-10-01 at 16:46 -0400, John Van Enk wrote:
. . .
I fully realize how un-clever this is. Some one please give me
something more worth of the original list. :)
You shoot the gun but nothing happens (Haskell is pure,
Benjamin L.Russell [EMAIL PROTECTED] writes:
Note: the singleton tuple does not support tuple syntax.
What is the syntax for the singleton tuple? [...]
the singleton syntax will be different from the non-singleton syntax,
which is also syntactically inelegant.
What is your solution?
Hello,
Given a type T, this type identifies a set of values and this set can be
deduced from the structure of type T.
i.e the type String is the set of all possible lists of character whatever
their length.
This being said, I have the following question:
Given a type T, how is it possible to
2008/10/2 Jon Fairbairn [EMAIL PROTECTED]:
Benjamin L.Russell [EMAIL PROTECTED] writes:
Note: the singleton tuple does not support tuple syntax.
What is the syntax for the singleton tuple? [...]
the singleton syntax will be different from the non-singleton syntax,
which is also
2008/10/2 jean-christophe mincke [EMAIL PROTECTED]:
Hello,
Given a type T, this type identifies a set of values and this set can be
deduced from the structure of type T.
i.e the type String is the set of all possible lists of character whatever
their length.
This being said, I have the
Hello jean-christophe,
Thursday, October 2, 2008, 1:46:20 PM, you wrote:
If one wants to use pattern matching,
afaik we had so-called views in early haskell versions. they proivide
way to define two-way constructors - used for deconstruction via
pattern-matching too
views wa removed from
On Tue, 30 Sep 2008 21:54:34 -0400, Stefan Monnier
[EMAIL PROTECTED] said:
I am not allowed to use such an interpretation. The (expensive and very
carefully researched) legal advice used to shape the use of Open Source
code at my employer has resulted in a no LGPL under any circumstances
Don Stewart ha scritto:
Thanks to those guys who've submitted parallel programs to the language
benchmarks game, we're climbing up the rankings, now in 3rd, and ahead
of C :)
http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=all
Just one or two more parallel programs
Adrian Neumann [EMAIL PROTECTED] writes:
Does this work with more than two colours? i.e. can I recursively
subdivide the halves into quarters with another cut?
I don't think so.
In order to divide a group, a line needs to pass through somewhere in
the middle, or more precisely, it must
Hi everybody,
The third pre-release of darcs 2.1 is now available at
http://darcs.net/darcs-2.1.0pre3.tar.gz
Since the last pre-release, we have resolved two of the items on our
work list and a recently discovered darcs 2 bug.
On the other hand, we have discovered a new regression from darcs
On Wed, Sep 24, 2008 at 08:14:34PM -0400,
Stephane Bortzmeyer [EMAIL PROTECTED] wrote
a message of 34 lines which said:
I cannot compile Streams 0.1:
This problem is experienced by other people:
http://groups.google.com/group/fa.haskell/browse_thread/thread/bafa0006f9fb2ba7
but nobody
On Wed, Oct 1, 2008 at 4:00 PM, Don Stewart [EMAIL PROTECTED] wrote:
And keep dividing our compiler teams' efforts, while
single-implementation languages conquer :)
Seems like Haskell has a pretty clear story about which is the right
implementation for general purpose use. I don't see a
Hello,
SCGI module from Hackage is not working for me with Apache mod_scgi, I
think because it uses LazyBytestring to hGetContents on a socket
handle and the Apache side does not close the socket. Also, looking at
the source I didn't see any fork* calls, so I assume it is not doing
concurrency.
On Thu, Oct 2, 2008 at 4:11 AM, Bulat Ziganshin
[EMAIL PROTECTED] wrote:
finally, ghc now includes some form of active patterns which may be
used to define your own way to decompose values. but their syntax
isn't compatible with constructors so you can't define complex type
which mimicks
On Thu, Oct 2, 2008 at 3:12 AM, Jeremy O'Donoghue
[EMAIL PROTECTED] wrote:
On Tue, 30 Sep 2008 21:54:34 -0400, Stefan Monnier
[EMAIL PROTECTED] said:
I am not allowed to use such an interpretation. The (expensive and very
carefully researched) legal advice used to shape the use of Open
2008/10/2 Darrin Thompson [EMAIL PROTECTED]
On Wed, Oct 1, 2008 at 4:00 PM, Don Stewart [EMAIL PROTECTED] wrote:
And keep dividing our compiler teams' efforts, while
single-implementation languages conquer :)
Seems like Haskell has a pretty clear story about which is the right
Hello,
I've recently been looking at Oleg's Iteratee approach to I/O
(http://okmij.org/ftp/Haskell/Iteratee/), and I was wondering about
something. In general this seems to be a very good approach to
handling sequential access, but I don't see a means of applying it
where non-sequential (esp.
Andrew Coppin wrote:
Anyway, the point I'm trying to get to is... would it be hard for
however maintains this library to add a little more flexibility in what
it can do please?
In the new System.Process, that comes with GHC 6.10.1:
Prelude System.Process createProcess (shell echo $FOO){ env
Hello,
I had some difficulty building hsql and hsql-mysql (native driver)
packages under GHC 8.3 on Fedora 9. Namely, they do not install with
cabal install, because of a few API changes. Is this considered all
right as GHC 8.3 is still experimental, or should the packages be
updated? If so, can
Op woensdag 01-10-2008 om 18:59 uur [tijdzone -0700], schreef Jason
Dusek:
Reply to all?
No. Reply-to-list is a different thing. When you reply-to-all to a
person who is in the list, the person gets two copies of the e-mail with
different headers, which messes with filters and replies.
Don't forget about memory consumption!
If you don't look, the bullet causes heap overflow. If you look, the
bullet causes stack overflow.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi all,
There's a common little situation I keep bumping up against. I don't understand
where I'm going wrong, so I've made a little example. It's to do with binding a
result to a variable name using -. This code works fine:
--
module Main where
On Thu, Oct 2, 2008 at 17:11, Albert Y. C. Lai [EMAIL PROTECTED] wrote:
Don't forget about memory consumption!
If you don't look, the bullet causes heap overflow. If you look, the bullet
causes stack overflow.
So it is a Heisenberg-bullet?
Arnar
Hi
You can translate this step by step.
main = do dc - getDirectoryContents ./foo/
mapM_ putStrLn dc
Translating out the do notation
(http://www.haskell.org/haskellwiki/Keywords#do):
main = getDirectoryContents = \dc -
mapM_ putStrLn dc
Then we can chop out the dc argument,
On Thu, Oct 2, 2008 at 3:50 PM, John Lato [EMAIL PROTECTED] wrote:
Hello,
I've recently been looking at Oleg's Iteratee approach to I/O
(http://okmij.org/ftp/Haskell/Iteratee/), and I was wondering about
something. In general this seems to be a very good approach to
handling sequential
The GPL and LGPL are needlessly difficult for mere
mortals to understand in their entirety, and as you've alluded to,
many lawyers would interpret it differently. I suspect many different
judges would too.
I think the evidence is rather to the contrary. Most lawsuits involving
Arnar Birgisson wrote:
So it is a Heisenberg-bullet?
I'm uncertain.
--
Joe Buehler
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Paul Keir [EMAIL PROTECTED] writes:
module Main where
import System.Directory (getDirectoryContents)
main = do dc - getDirectoryContents ./foo/
mapM_ putStrLn dc
mapM_ putStrLn (getDirectoryContents ./foo/)
Couldn't match expected type `[String]'
mapM_ putStrLn needs a
[EMAIL PROTECTED] wrote:
One, if the cut is allowed to be curved and self-intersecting.
Crouching Tiger, Hidden Dragon? Kill Bill?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
main = do dc - getDirectoryContents ./foo/
mapM_ putStrLn dc
Translating out the do notation
(http://www.haskell.org/haskellwiki/Keywords#do):
main = getDirectoryContents = \dc -
mapM_ putStrLn dc
Woops, I lost ./foo/ here, but it should be fairly easy to insert
through
Thanks, and to Ketil too. I did see past the missing ./foo/. That's certainly
a solution I'm happy with, and I didn't know the term eta reduction, so thanks
for that too.
Paul
-Original Message-
From: Mitchell, Neil [mailto:[EMAIL PROTECTED]
Sent: Thu 02/10/2008 16:26
To: Paul Keir;
Hello Neil,
Thursday, October 2, 2008, 7:26:23 PM, you wrote:
shortly speaking, getDirectoryContents is an action (having
IO a type) while second mapM_ argument should be a value returned by
this action. by using dc variable or = operator, you can evaluate
action and pass its result to mapM_. of
On Thu, Oct 2, 2008 at 4:28 PM, Johan Tibell [EMAIL PROTECTED] wrote:
On Thu, Oct 2, 2008 at 3:50 PM, John Lato [EMAIL PROTECTED] wrote:
Hello,
I've recently been looking at Oleg's Iteratee approach to I/O
(http://okmij.org/ftp/Haskell/Iteratee/), and I was wondering about
something. In
manlio_perillo:
Don Stewart ha scritto:
Thanks to those guys who've submitted parallel programs to the language
benchmarks game, we're climbing up the rankings, now in 3rd, and ahead
of C :)
http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=all
Just one or two more
John Van Enk wrote:
There's the well known How to shoot your self in the foot list which
I have it printed and taped on my desk at work.
http://www-users.cs.york.ac.uk/susan/joke/foot.htm
I had a co-worker ask me how you'd shoot your self in the foot with
Haskell.
The interesting thing
It seems like if your primitive operation is break bar in two you
need exactly n-1 breaks to get n squares, no matter what choice you
make for where to break along the chocolate grid. This is a simple
consequence of the fact that each break increases the number of pieces
by one.
If you're
Consider the following beautiful code:
run :: State - Foo - ResultSet State
run_and :: State - Foo - Foo - ResultSet State
run_and s0 x y = do
s1 - run s0 x
s2 - run s1 y
return s2
run_or :: State - Foo - Foo - ResultSet State
run_or s0 x y = merge (run s0 x) (run s0 y)
That
Don Stewart ha scritto:
[...]
There is a lot of efforts to improve CPU time, but what about memory usage?
http://shootout.alioth.debian.org/u64q/benchmark.php?test=alllang=ghclang2=ghc
No one is looking at memory at the moment, as the parallel/multicore
profiler isn't working in 6.8.2.
On Thu, 2008-10-02 at 18:18 +0100, Andrew Coppin wrote:
Consider the following beautiful code:
run :: State - Foo - ResultSet State
run_and :: State - Foo - Foo - ResultSet State
run_and s0 x y = do
s1 - run s0 x
s2 - run s1 y
return s2
run_or :: State - Foo - Foo
On Thu, Oct 02, 2008 at 06:18:19PM +0100, Andrew Coppin wrote:
run :: State - Foo - Either ErrorType (ResultSet State)
run_and :: State - Foo - Foo - Either ErrorType (ResultSet State)
{- some Either-ified version of
run_and :: State - Foo - Foo - ResultSet State
run_and s0 x y =
On Thu, Oct 2, 2008 at 1:18 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
At this point I am sorely tempted to just change ResultSet to include the
error functionallity I need. However, ResultSet is *already* an extremely
complicated monad that took me weeks to get working correctly... I'd really
On Wed, Oct 1, 2008 at 7:53 PM, wren ng thornton [EMAIL PROTECTED] wrote:
[1] Just like existential types, you can put something in but you can never
get it back out again. For inescapable monads like IO and ST, this is why
they have the behavior of sucking your whole program into the
Am Dienstag, 30. September 2008 00:18 schrieb Duncan Coutts:
Yet another reason for getting dynamic linking / shared libs for Haskell
packages working reliably on all platforms.
You mean shared libraries without the opportunity to inline library code?
This would result in a huge performance
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Wolfgang Jeltsch wrote:
Am Dienstag, 30. September 2008 00:18 schrieb Duncan Coutts:
Yet another reason for getting dynamic linking / shared libs for Haskell
packages working reliably on all platforms.
You mean shared libraries without the
On Wed, Oct 1, 2008 at 6:03 PM, Simon Marlow [EMAIL PROTECTED] wrote:
[..]
Dynamic linking doesn't solve all the problems, we still have the problem
that GHC does a lot of cross-module inlining, regardless of whether dynamic
linking is used. However, I really would like to have a way to have
Am Donnerstag, 2. Oktober 2008 20:33 schrieben Sie:
Wolfgang Jeltsch wrote:
You mean shared libraries without the opportunity to inline library code?
This would result in a huge performance loss, I think.
Usually _mild_ performance loss, in exchange for major code-size
savings, I would
On Thu, Oct 2, 2008 at 11:25 AM, Wolfgang Jeltsch
[EMAIL PROTECTED] wrote:
Am Dienstag, 30. September 2008 00:18 schrieb Duncan Coutts:
Yet another reason for getting dynamic linking / shared libs for Haskell
packages working reliably on all platforms.
You mean shared libraries without
David Menendez wrote:
In general, monads don't compose. That is, there's no foolproof way to
take two monads m1 and m2 and create a third monad m3 which does
everything m1 and m2 does. People mostly get around that by using
monad transformers.
...OK then.
You could try using an exception
Reid Barton wrote:
I'll assume for simplicity and concreteness that ResultSet = [].
It more or less is. (But with a more complex internal structure, and
correspondingly more complex (=) implementation.)
That's right. The type mismatches are telling you that there's a
situation you
Hello Wolfgang,
Thursday, October 2, 2008, 11:25:52 PM, you wrote:
You mean shared libraries without the opportunity to inline library code?
This would result in a huge performance loss, I think.
Usually _mild_ performance loss, in exchange for major code-size
savings, I would think. C
Jonathan Cast wrote:
On Thu, 2008-10-02 at 18:18 +0100, Andrew Coppin wrote:
After an insane amount of time making my head hurt, I disocvered that
the type Either ErrorType (ResultSet State) is actually a monad.
It's a monad if you can write a function
join :: Either ErrorType
All,
I'm bundling responses to save paper.
[EMAIL PROTECTED] wrote:
I hope it has a Monad instance.
Naturally!
But more to the point: Can it send email?
Can you give an example of a use case? Do the Haskell-98 standard
tuples have a correspondence feature? I wasn't able to find one with
Andrew Coppin wrote:
I thought ErrorT was a class name...?
No, it's the name of the error monad transformer type. Error is just
an ordinary monad, it's ErrorT that's the transformer. So it sounds
like the answer to your question below:
You could try using an exception monad transformer
On Thu, Oct 02, 2008 at 03:58:12PM -0400, John Dorsey wrote:
All,
I'm bundling responses to save paper.
[EMAIL PROTECTED] wrote:
I hope it has a Monad instance.
Naturally!
But more to the point: Can it send email?
Can you give an example of a use case? Do the Haskell-98
--- On Thu, 10/2/08, Andrew Coppin [EMAIL PROTECTED] wrote:
I'm lost...
(What does liftM have to do with fmap?)
They're (effectively) the same function.
i.e.
liftM :: (Monad m) = (a - b) - m a - m b
fmap :: (Functor f) = (a - b) - f a - f b
liftM turns a function from a to b into a
Robert Greayer wrote:
--- On Thu, 10/2/08, Andrew Coppin [EMAIL PROTECTED] wrote:
I'm lost...
(What does liftM have to do with fmap?)
They're (effectively) the same function.
i.e.
liftM :: (Monad m) = (a - b) - m a - m b
fmap :: (Functor f) = (a - b) - f a - f b
Hmm.
2008/10/1 George Pollard [EMAIL PROTECTED]:
Since the ID3 tag as a whole has size information, I need to pass that
into the frame-reading functions to ensure that I never read past the
end of the total header.
What you want for this is the environment monad, also known as the
Reader monad in
2008/10/2 John Dorsey [EMAIL PROTECTED]:
All,
I'm bundling responses to save paper.
[EMAIL PROTECTED] wrote:
I hope it has a Monad instance.
Naturally!
But more to the point: Can it send email?
Can you give an example of a use case? Do the Haskell-98 standard
tuples have a
On Thu, Oct 2, 2008 at 6:39 PM, Duncan Coutts
[EMAIL PROTECTED] wrote:
The problem here really is that HSQL has no maintainer and has not been
updated for about two years if my memory serves me correctly. Some
distros, Fedora, Gentoo etc have patched HSQL to keep it working with
ghc-6.8.
I
Hi.
I'm starting to write a CSS parser with Alex and Happy.
The grammar is defined here:
http://www.w3.org/TR/CSS21/grammar.html
However I have noted that there are some difference in the syntax
between Alex and Flex?
What is the rationale?
One more thing.
Here:
Hi.
I'm starting to write a CSS parser with Alex and Happy.
The grammar is defined here:
http://www.w3.org/TR/CSS21/grammar.html
However I have noted that there are some difference in the syntax
between Alex and Flex?
What is the rationale?
One more thing.
Here:
On Thu, 2008-10-02 at 20:53 +0100, Andrew Coppin wrote:
Jonathan Cast wrote:
On Thu, 2008-10-02 at 18:18 +0100, Andrew Coppin wrote:
After an insane amount of time making my head hurt, I disocvered that
the type Either ErrorType (ResultSet State) is actually a monad.
It's a
John Dorsey [EMAIL PROTECTED] wrote:
Now you can:
* Solve any of the software problems that cannot be solved without
the singleton tuple !
What would those be? I'm still trying to figure out how a
singelton tuple is really distinct from a plain value.
--
_jsn
Hi Andrew,
Andrew Coppin wrote:
Uh... what's Applicative? (I had a look at Control.Applicative, but
it just tells me that it's a strong lax monoidal functor. Which
isn't very helpful, obviously.)
Seriously, what are you talking about? The haddock page for
Control.Applicative hoogle links to
On Thu, Oct 2, 2008 at 3:40 PM, Andrew Coppin
[EMAIL PROTECTED] wrote:
David Menendez wrote:
You could try using an exception monad transformer here
I thought I already was?
No, a monad transformer is a type constructor that takes a monad as an
argument and produces another monad. So,
bulat.ziganshin:
Hello Wolfgang,
Thursday, October 2, 2008, 11:25:52 PM, you wrote:
You mean shared libraries without the opportunity to inline library code?
This would result in a huge performance loss, I think.
Usually _mild_ performance loss, in exchange for major code-size
anton.tayanovskyy:
Hello,
SCGI module from Hackage is not working for me with Apache mod_scgi, I
think because it uses LazyBytestring to hGetContents on a socket
handle and the Apache side does not close the socket. Also, looking at
the source I didn't see any fork* calls, so I assume it is
Hello Don,
Friday, October 3, 2008, 2:22:49 AM, you wrote:
and type classes. once i've forget to addinline pragma, my program
(serializing arrays) becomes 200x slower. it was due to use of
hieararchy of several type classes. afaiu, their dictionaries are also
lazily evaluated plus we have
On Thu, Oct 2, 2008 at 2:46 PM, Jason Dusek [EMAIL PROTECTED] wrote:
John Dorsey [EMAIL PROTECTED] wrote:
Now you can:
* Solve any of the software problems that cannot be solved without
the singleton tuple !
What would those be? I'm still trying to figure out how a
singelton
Just FYI, at Credit Suisse I wrote a 1-tuple type a few years ago. It
was the only way to get a consistent way of dealing with certain
things.
But I called it One.
I think the OneTuple should be in the base library, I mean, ask an 8
year old what number is missing in this sequence
If your datatype with a Monad instance also has a Functor instance (which it
*can* have, you just need to declare the instance), then liftM is equivalent
to fmap.
Only if you ignore efficiency issues, of course. Some monads have an
fmap which is significantly faster than bind.
liftM f m =
Folks:
For research on the behavior of parallel Haskell, does anyone know of a
source for graded (easy through evil) 16x16 Sudoku puzzles? Our hardware
runs too fast for us to get meaningful timings on 9x9's. I suppose we
could insert time wasters, but I think that would also distort the
On 2008 Oct 2, at 19:00, Jason Dagit wrote:
On Thu, Oct 2, 2008 at 2:46 PM, Jason Dusek [EMAIL PROTECTED]
wrote:
John Dorsey [EMAIL PROTECTED] wrote:
Now you can:
* Solve any of the software problems that cannot be solved without
the singleton tuple !
What would those be? I'm still
Simon Tatham has a sudoku program which generates Sudoku's of any size in
varying difficulties:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/
It's down at the bottom and is called Solo.
I can't speak to the actual quality/difficulty of the puzzles, but every
feature you asked for is
83 matches
Mail list logo