2009/12/4 Evan Laforge qdun...@gmail.com:
The interesting thing is CAFs, which at the top level will never be
out of scope and hence live forever.
Untrue! CAFs can be garbage collected as well. See:
http://www.haskell.org/pipermail/glasgow-haskell-users/2005-September/009051.html
See also the paper Idioms are oblivious, arrows are meticulous,
monads are promiscuous [1]. Functors can be extended to give
applicative functors (idioms) which can then be extended to arrows,
and then monads. So all arrows are also (applicative) functors.
[1]:
Conor also calls these functors:
http://strictlypositive.org/slicing-jpgs/
The fixpoint construction builds recursive types (think trees) from
functors by identifying superstructures with substructures: each node
frames its children.
___
Haskell-Cafe
I'd also like to note that the canonical pronunciation of DSL ends in -izzle.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Just occurred to me that you can actually do this with a preprocessor.
If we extract the template declarations to a separate module, then
it can happen something like this (I have corrected some errors in the
above code):
main.hs
import Language.Haskell.TH
import QList
import
Oh, and output is as expected:
./test
(1,2,3)
1
(1,(2,3))
((1,2),3)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Also (sorry for the triple-post!) I noticed that in the TH
documentation, it says:
Type splices are not implemented, and neither are pattern splices
This means, while we could write a preprocessor that would give us, e.g.:
x :: Set Int
x = {1,2,3,4}
We cannot splice in the right
Dear all,
Here is a note concerning a thought I just had. I have written a rough
sketch/outline and
would like feedback upon this.
The beginning thought: I would like to be able to write new
bracket-like operators
without having to rewrite GHC. (Case in point: applicative brackets.)
First idea
2009/8/26 Lennart Augustsson lennart.augusts...@gmail.com:
Try 10^1000
Cheat :)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
You could also fudge the input:
{-# LANGUAGE NoMonomorphismRestriction #-}
log10 = floor . logBase 10 . (0.5+) . fromIntegral
numDigits n | n 0 = 1 + numDigits (-n)
numDigits 0 = 1
numDigits n = 1 + log10 n
-- checked [0..10^8], finding a counter-example is left as an exercise
2009/8/7 Neil Mitchell ndmitch...@gmail.com:
Which leaves me with the option of getting the darcs repo and looking
through darcs changes. If I know of a repository for the package.
I also don't tag the darcs version when I make a release - I probably
should...
This could be a nice feature
For each item, we ignore what the item actually is (hence `const`),
and say that we both want it (True) and don't want it (False) in the
output. Since we are using the list monad we are allowed to say this,
and the filter function gives us a list of lists. I think there's
probably a more intuitive
It does seem that having quantified contexts would make this *much* easier...
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ok, so I have a small idea I'm trying to work on; call it a
Prelude-rewrite if you want. For this I want to be able to have the
hierarchy Functor → Applicative → Monad.
For Functor, I would like to be able to implement it for a wider
variety of types, as there are types which have aren't
2009/7/7 Matthias Görgens matthias.goerg...@googlemail.com:
Karmic (9.10) will have GHC 6.10.3, possibly 6.10.4.
It currently spots 6.10.3, in the alpha release I run here.
A major problem is that the libraries are still for 6.8.2, so you
cannot install the required libs to install cabal. Grr.
I believe there might be an elegant solution for this using the `Last` monoid
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
This discussion points to a wider issue: at some stage we should look
at pulling all the nice new stuff into Haskell prelude. I'm looking
at you, Data.Foldable,Traversable.
Also, throw out `map`. ;)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
2009/7/4 Jason Dusek jason.du...@gmail.com:
2009/07/03 George Pollard por...@porg.es:
Also, throw out `map`. ;)
What is the proper name for the operation on functions of a
functor, anyway? The name `fmap` seems to driven by an analogy
with `map`.
This is getting a little off topic, but I
On Fri, 2009-02-27 at 00:01 -0800, Bryan O'Sullivan wrote:
text-icu 0.1
Augments text with comprehensive character set conversion support and
normalization (and soon more), via bindings to the ICU library.
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text-icu
Excellent! I was
Unfortunately it doesn’t build for me. I have libicu-dev 3.8.1
installed.
$ cabal install text-icu
Resolving dependencies...
'text-icu-0.1' is cached.
Configuring text-icu-0.1...
Preprocessing library text-icu-0.1...
Error.hsc: In function ‘main’:
Error.hsc:229: error:
Okay, so I've written a small library to generalize 'fst' and 'snd' to
arbitrary tuples, but I'd like to extend it a bit. I'm using the
type-level library to do the thinking :)
Imports and defines first:
{-# LANGUAGE UnicodeSyntax, MultiParamTypeClasses,
FunctionalDependencies,
On Mon, 2009-02-16 at 15:30 +0100, Fraser Wilson wrote:
Super! Also, best definition of bottom I've yet seen -- ignoring _|
_, which is a party pooper. Like good code, it's short, to the
point, and obviously correct.
This brings up something I've thought about: On page 8, it is said that
On Fri, 2009-02-13 at 22:39 +1100, George Pollard wrote:
RewriteRule ^packages/archive/[^/]+/[^/]+/(.+)$ - [env=pkgname:$1]
This should actually be more constrained since (as I've just noticed)
more than just packages are under this path :)
Perhaps:
RewriteRule ^packages/archive
On Fri, 2009-02-13 at 11:40 +0100, Daniel Kraft wrote:
Colin Adams wrote:
If you have two functions that do two different things, then they
certainly OUGHT to have different names.
Well, they do the same thing but for different arguments; it's like this:
Table is a table of name-value
On Fri, 2009-02-13 at 10:58 +, Duncan Coutts wrote:
Hi folks,
Does anyone have any experience with apache configuration, particularly
mime types and handling browser quirks and would like to help us with an
issue we have on hackage?
http://hackage.haskell.org/trac/hackage/ticket/498
On Fri, 2009-02-13 at 12:19 +, Duncan Coutts wrote:
Can we do that just for one user agent? I don't think we want to use
non-standard stuff in general. Apparently Content-Disposition is not in
the official HTTP spec, but IE is known to follow it.
It's not in the HTTP spec, but it's about
On Thu, 2009-02-12 at 11:08 +0100, Heinrich Apfelmus wrote:
Benja Fallenstein wrote:
Kim-Ee Yeoh wrote:
On the same note, does anyone have ideas for the following snippet? Tried
the
pointfree package but the output was useless.
pointwise op (x0,y0) (x1,y1) = (x0 `op` x1, y0 `op`
Can you live with
infixl |$|
(|$|) :: [a - r] - a - [r]
fs |$| x = map ($ x) fs
and, instead of broadcast fs a b use
fs |$| a |$| b
?
map ($ x) fs
= { Applicative Functors satisfy... }
pure ($ x) * fs
= { 'interchange' rule from Control.Applicative }
fs * pure x
Thus;
On Wed, 2009-02-11 at 01:50 +0100, Manlio Perillo wrote:
George Pollard ha scritto:
[...]
So, it seems nanosleep get interruped by a signal.
This works:
import System.Posix
main = do
putStrLn Waiting for 5 seconds.
blockSignals $ addSignal sigVTALRM emptySignalSet
I can confirm this behaviour, on:
Linux 2.6.27-11-generic #1 SMP i686 GNU/Linux
Difference in the RTS between non-working and working:
(RTS way, rts_thr)
(RTS way, rts)
- George
signature.asc
Description: This is a digitally signed message part
On Tue, 2009-02-10 at 09:57 -0800, Corey O'Connor wrote:
The POSIX sleep function is defined as:
sleep() makes the current process sleep until seconds seconds have
elapsed or a signal arrives which is not ignored.
Sounds like a signal is arriving that is interrupting the sleep.
-Corey
On Wed, 2009-02-11 at 00:05 +0100, Manlio Perillo wrote:
John Ky ha scritto:
Hi Haskell Cafe,
I wrote very short program to sleep for 5 seconds compiled with the
-threaded option in ghc on the Mac OS X 1.5.
I am finding that using the sleep function doesn't sleep at all, whereas
Also attached is a diff for strace between non-threaded and threaded.
execve(./sleep, [./sleep], [/* 38 vars */]) = 0
execve(./sleep, [./sleep], [/* 38 vars */]) = 0
brk(0) = 0x83c2000 | brk(0)
= 0x8ff
On Tue, 2009-02-10 at 08:03 +0100, Thomas Davie wrote:
On 10 Feb 2009, at 07:57, Max Rabkin wrote:
On Mon, Feb 9, 2009 at 10:50 PM, Iavor Diatchki
iavor.diatc...@gmail.com wrote:
I 0 * _ = I 0
I x * I y = I (x * y)
Note that (*) is now non-commutative (w.r.t. _|_). Of
On Fri, 2009-02-06 at 01:35 +0100, David Waern wrote:
I received this question from Lennart Augustsson (via Simon M) and
thought I'd send out an inquiry to the Haskell community in general
(Lennart, I hope you don't mind):
Lennart writes:
We have some local patches for haddock that extends
On Wed, 2008-12-24 at 12:05 +, Johannes Waldmann wrote:
in F# they renamed Monad to Workflow,
see e.g. Chapter 9 (p. 230) in the Expert F# book.
http://www.expert-fsharp.com/default.aspx
I don't think this is helpful, it only really works for state-like
monads. Workflow doesn't make sense
On Fri, 2009-01-23 at 16:19 +1100, Toby Hutton wrote:
On Fri, Jan 23, 2009 at 11:56 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Not really. My company *advertises* for Haskell developers, and then
when they come in to interview, informs them that the code base is
actually
On Fri, 2009-01-23 at 21:30 +, Joachim Breitner wrote:
Hi,
Am Freitag, den 23.01.2009, 21:50 +0100 schrieb Henning Thielemann:
However our recent Monoid discussion made me think about mapM_,
sequence_, and friends. I think they could be useful for many monads if
they would have
On Mon, 2009-01-12 at 20:24 -0200, rodrigo.bonifacio wrote:
Hi all,
I'm trying to build a library that has the following code:
hasTypeOf (TermRep (dx,_,_)) (x::t)
= ((fromDynamic dx)::Maybe t)
Could you do something like this?
Enforce the types with a signature:
hasTypeOf :: (Typeable
On Wed, 2009-01-14 at 15:59 +0100, Manlio Perillo wrote:
1) In a Python string it is available the \U{name} escape, where name is
a character name in the Unicode database.
As an example:
foo = uabc\N{VULGAR FRACTION ONE HALF}
This is possible via QuasiQuotation, you can
On Thu, 2009-01-15 at 18:10 -0500, Cale Gibbard wrote:
My personal preference would be:
class Monoid m where
zero :: m
(++) :: m - m - m
(in the Prelude of course)
- Cale
I've tried doing this (and making more widespread use of typeclassed
operations) by writing my own
On Mon, 2009-01-12 at 21:48 +, Robin Green wrote:
convert b = unfoldr (\n - if n 0 then Just (n `mod` b, n `div`
b) else Nothing)
I have the nice function 'toMaybe' which simplifies this to:
unfoldr (\n - toMaybe (n0) (n `mod` b, n `div` b))
I would use the more general
On Tue, 2009-01-13 at 11:46 -0600, Derek Elkins wrote:
No, it means exactly what you said it means. People abuse it to mean
the second sense. Those people are wrong and there is already a term
for that second sense, namely partial application. I really wish
people would stop conflating
On Fri, 2008-12-19 at 00:10 -0800, Ashley Yakeley wrote:
I browsed around a bit for logos from other languages...
...
All of these get one thing right that the current and most of the
proposed Haskell logos do not: they don't make any reference to the
syntax of the language itself. Doing so
On Thu, 2008-12-18 at 22:35 -0500, wren ng thornton wrote:
In a similar vein, is there already a function available to give the
size of Word in bytes? Or should I write the usual Ptr conversion tricks
to figure it out?
How about this:
(`div` 8) $ ceiling $ logBase 2 $ fromIntegral (maxBound
It has a military feeling I don't like...
Might look cuddlier with slightly rounded edges. That's what all the
cool kids[1] are doing anyway ;)
[1]: http://www.python.org/
signature.asc
Description: This is a digitally signed message part
___
On Wed, 2008-12-17 at 21:46 +0100, Martijn van Steenbergen wrote:
If you play with the angles and vary the stroke thicknesses you'll
probably get a friendlier look, vs. the military/airline look these
have now. The first '' doesn't have to be the same thickness as the
lambda.
If you
Might be interesting to try angling the ends of the stems to look
something more like the guillemot in [1]. I might try this in Gimp but
I'm no designer :P
Here is what I got; I think I chose the wrong yellow :) Based it on the
font Diavlo, which is free.
attachment: hasklogo.png
On Tue, 2008-12-16 at 12:40 -0500, Darrin Thompson wrote:
My $0.02 us:
Apologies for ascii art, and hopefully gmail doesn't munge this:
\\ \\
\\ \\ \|
\\ \\ ---
\\ \\
// / \
On Wed, 2008-12-17 at 02:47 +, Jeff Wheeler wrote:
Darrin Thompson darrinth at gmail.com writes:
My $0.02 us:
Apologies for ascii art, and hopefully gmail doesn't munge this:
I love this ASCII-art version. I tried to make a vector version of it in
Photoshop, and I came up with
On Mon, 2008-12-15 at 08:40 +, Neil Mitchell wrote:
That can only be a bug in stream fusion - concatMap should always be prefered!
Yes, but it is unclear from the article whether the concatMap (w/ stream
fusion enabled) is Data.List.Stream's concatMap or the Prelude's
concatMap. It's only a
So I retract that email ;)
signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Good afternoon Café,
I've written a little bit of code to calculate minimal complete
definitions for a class given which of its functions use which other
functions.
As an example:
doDependencies ord =
([],[[=],[compare]])
doDependencies num =
Code might help :P
import qualified Data.Set as Set
import Data.Set (Set)
import Data.List (partition,delete)
import Data.Maybe (isJust,fromJust)
-- A snippet for working out minimal complete definitions.
num =
[
(plus,Nothing),
(times,Nothing),
(abs,Nothing),
(minus,Just [negate]),
Sorry about the triple-post, but I forgot to note it only goes to one
'depth' of OR; in reality the MCD for wrongOrd should be ( OR ((=) AND
(compare OR )) OR compare). This requires a slightly more complicated
type than [[a]] :)
signature.asc
Description: This is a digitally signed message part
?
attachment: cover.jpg
signature.asc
Description: This is a digitally signed message part
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Sun, 2008-12-14 at 00:35 -0500, Adam Vogt wrote:
On another note, is there much use of such simple library functions: does
concatMap, for instance, save anything other than a couple parantheses, or
does (concat . map) not necessarily get optimized into the same thing
Bart Massey’s results
On Sun, 2008-12-14 at 19:46 +1300, George Pollard wrote:
On Sun, 2008-12-14 at 00:35 -0500, Adam Vogt wrote:
On another note, is there much use of such simple library functions: does
concatMap, for instance, save anything other than a couple parantheses, or
does (concat . map
Is there a good way of doing this? My running example is Monoid:
class Monoid a where
operation :: a - a - a
identity :: a
With the obvious examples on Num:
instance (Num a) = Monoid a where
operation = (+)
identity = 1
instance (Num a) = Monoid a where
Hello Haskell-Café:
This is a little bit random, but I was just wondering if anyone knew
where the $ low-precedence parenthesis-eliminating application operator
originated. The Haskell Report doesn't mention anything, and I can't
search for $ on Google. So... who thought it up? Does it originate
There's also the ieee-utils package, which provides an IEEE monad with
`setRound`:
http://hackage.haskell.org/packages/archive/ieee-utils/0.4.0/doc/html/Numeric-IEEE-RoundMode.html
signature.asc
Description: This is a digitally signed message part
___
On Thu, 2008-10-16 at 09:01 +0100, Ryan Ingram wrote:
Isn't this an unsound rewrite?
Yeah, hence the just for fun :)
Anyways, the reason for inlining not being done if an expression is
used more than once is that it duplicates work that you explicitly
specified should only be done once (by
Thanks to all that replied (Derek Ryan for the major understanding,
Albert Luke also)*. I guess I was getting confused with the error
message:
(All instance types must be of the form (T a1 ... an)
I was interpreting this with Stringable/Enum as T and [Char]/Blah as
a1.
Now I have clarity! I
Section 8.13.2 of the GHC manual[1] states:
GHC keeps trying to apply the rules as it optimises the program. For
example, consider:
let s = map f
t = map g
in
s (t xs)
The expression s (t xs) does not match the rule map/map, but GHC
will substitute for s and t, giving an
Needs text in Haskell's official font ;)
http://research.microsoft.com/~simonpj/papers/haskell-tutorial/TasteOfHaskell.pdf
http://research.microsoft.com/~simonpj/papers/ndp/NdpSlides.pdf
http://research.microsoft.com/~simonpj/papers/marktoberdorf/Marktoberdorf.ppt
signature.asc
Description:
On Mon, 2008-10-06 at 21:06 -0500, Mike Coleman wrote:
There's a readInt method, which I guess I could use, but it returns a
Maybe, and I don't see how I can easily strip that off.
You can use Data.Maybe's 'mapMaybe' function
The mapMaybe function is a version of map which can throw out
Hello all,
I'm currently working on a (toy) ID3 [1] tag reader, which made me think
of a library which might be quite useful.
The structure of an ID3 tag goes something like this:
Header:
- total size of tag
- other header info
A series of frames, each with:
- total size of frame
- other
Hi, first time list poster :)
I've searched around a bit but haven't been able to find any examples of
this. I want to be able to parse a language (such as Haskell, Python)
which has only EOL as the 'statement' separator and has indentation
levels to indicate block structure. Whilst doing this I
68 matches
Mail list logo