(Not really Haiku form:)
Haskell Weekly News, finally back!
Nooo, they just hid in the café!?
So many to catch up... 3.
Oh, I'm so happy!
Daniel! Thanks!
- Marc
Am Thursday 21 October 2010 schrieb Daniel Santa Cruz:
Hello all,
Malcolm Wallace noticed that I had not posted the HWN to
slow and lazy... that's me, too. but haskell is not slow.
how about an octopus?
there are some kinds (or all?), which are more chameleon like than real
chameleons; they can look like strange fishes, stones, or whatever.
they have a decentralized brain (like multi core), are really intelligent
there was a thread about xml parsing, one month ago.
http://thread.gmane.org/gmane.comp.lang.haskell.cafe/44708
well, i don't know much about xml, except what it looks like;
but i know about that interesting parsing problem behind it.
maybe Lev Walkin has fixed that in HXML. at least he wrote this
-- Lazily build a tree out of a sequence of tree-building events
build :: [TreeEvent] - ([UnconsumedEvent], [Tree String])
build (Start str : es) =
let (es', subnodes) = build es
(spill, siblings) = build es'
in (spill, (Tree str
i think, you are looking for this paper:
Functional programming with bananas, lenses, envelopes and barbed wire
http://citeseer.ist.psu.edu/meijer91functional.html
atm, the link is broken or server offline. so here is another reference...
http://doc.utwente.nl/56289/
the paper is pretty cool,
GADTs always reminds me of the japanese word gattsu.
ガッツ == ga-tsu-tsu == gattsu, spoken somehow like gah-t--ts... followed
by a half spoken english u (second half).
gattsu means in english guts.
that in mind, i was just GADDing in StarDict, which translates gatsugatsu
with burning with desire
Am Freitag, 21. Dezember 2007 schrieb Justin Bailey:
Given this function:
dropTest n = head . drop n $ [1..]
I get a stack overflow when n is greater than ~ 550,000 . Is that
inevitable behavior for large n? Is there a better way to do it?
Justin
[1..] equals [1, (1)+1, (1+1)+1,
Am Dienstag, 18. Dezember 2007 schrieb Joost Behrends:
snip
fix f is the least fixed point of the function f, i.e. the least defined x
such that f x = x.
What does least mean here ? There is nothing said about x being a variable
of
an instance of Ord. And why fix has not the type a - (a
Am Mittwoch, 12. Dezember 2007 schrieb Miguel Mitrofanov:
Gtk2Hs is good (I suppose), but it requires X. OK, I have X, but it's
not native on my Mac; some Mac users don't install it and almost
all Mac users don't always run it.
the problem is Apple. if you want to have a native gui on OSX
i did just read the haskell description from galois [1]. i like
1) ...enabling much higher coding efficiency, in addition to formalisms that
greatly ease verification.
2) All programming languages suffer from a semantic gap:...
maybe we could compose sth similar to 1) to introduce static typed
Marc A. Ziegert [EMAIL PROTECTED]
tm_parallelizable_v1 = \n - sum . takeWhile (0) $ map (div n) fives
where fives = iterate (*5) 1
tm_improved_v1 n = sum . takeWhile (0) $ iterate (div `flip` 5) (div n 5)
tm_fastestIMHO n = let m=div n 5 in if m5 then m else m+tm_fastestIMHO m
whops... i did check it, but
that was a copypaste mistake.
buggy:
tm_parallelizable_v1 = \n - sum . takeWhile (0) $ map (div n) fives
where fives = iterate (*5) 1
should be:
tm_parallelizable_v1 = \n - sum . takeWhile (0) $ map (div n) fives
where fives = iterate (*5) 5
- marc
i interpret it as this:
all [ usage x usage y || fun_to_talk_about x fun_to_talk_about y
| let lang=[minBound .. maxBound] -- C++,Haskell,Java,etc.
, x-lang
, y-lang
, irc_channel_users x irc_channel_users y
]
- marc
Am Dienstag, 21. August 2007 schrieb Albert Y. C.
i just don't get it.
please, can anybody explaim me how to do that?
i tried it the last few days with ghc-6.7.20070807, ghc-6.7.20070809, and
ghc-6.7.20070810.
it always results in a broken library (without Prelude):
# ghc-pkg list
/usr/local/lib/ghc-6.7.20070810/package.conf:
Am Montag, 6. August 2007 00:48 schrieb Frank Buss:
I've created a small program to compose images with combinators:
http://www.frank-buss.de/haskell/OlympicRings.hs.txt
...
look very smooth. And it is very slow, it needs about 40 seconds on my
computer to calculate the image. Using
in old glut, the main loop was the core of the single threaded program. exiting
it did mean to exit the program completely.
in freeglut, you have alternatives. but for compatibility, it defaults to the
old behaviour.
to replace only libglut.so is not enough. if i understand you correctly, you
changed the backend without the API. (you need .h at compiletime, .a (an
archive of .o files) when you link everything to an executable, and .so at
runtime.)
my libglut installation comes with...
/usr/lib/libglut.a
This is ghc 6.6. Anyone else seeing this?
not here.
what do these output:
ghc --version
and
ghci --version
? are they different?
besides that.. why do you use 6.6? may it bee.. is your Unix-like OS sth
between OSX and linux? (i remenber there exists a Gnu/Darwin package manager
without the
Am Dienstag, 10. Juli 2007 00:25 schrieb Albert Y. C. Lai:
http://xkcd.com/c287.html
It disappoints me that there is no solution if each item is used at most
once. However, do change the code to allow multiple uses, then there are
many solutions.
i see only two solutions.
let menu = [215,
exercise done. :D
there is still a problem with the functional dependencies. see last line of
code.
- marc
Am Mittwoch, 4. Juli 2007 14:22 schrieb Conor McBride:
{? * 10 + ?} 4 2 = 42
http://hackage.haskell.org/trac/haskell-prime/wiki/FlexiblePartialApplication
(3) Exercise for
well, i see sth like this:
data IceCream = EmptyCone | Vanilla | Strawberry | Wasabi | ...
data Hypothetical a = ...
instance Monad Hypothetical where -- one Functor and two Natural
Transformations:
fmap :: (a - b) - (Hypothetical a - Hypothetical b)
return :: a - Hypothetical a
join
http://xkcd.com/c248.html
( join /= coreturn )
IMHO this could be a beautiful and easy way to explain monads.
comments?
- marc
pgpTFyuRioL8Y.pgp
Description: PGP signature
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Am Donnerstag, 31. Mai 2007 05:52 schrieb PR Stanley:
What is the basic philosophy for Bool being a member of Ord?
you can do sth like
Data.Set.fromList [minBound .. maxBound] :: Data.Set.Set Bool
What justifies False True?
in most interpretations this equals:
False == 0
True == 1
and == (*)
you may want to use a container like Array or Map.
most times i use an Array myself to speed things up like this.
with Map it will either be a bit tricky or you'll need to use an unsafeIO hack.
here are some functions that may help you. my favorites are Array and MapMealey.
- marc
with which model in Combinatorics in mind do you want that function? with or
without repetition?
http://en.wikipedia.org/wiki/Combinatorics#Permutation_with_repetitionthe
order matters and each object can be chosen more than once
i don't know where my copy is or who it has, for years.
but i remember one bad thing... either i missread the following (my english was
not that good) or it is a bug in the book:
(in the first chapter, i guess)
if you have the function
sqr x = x*x
then haskell does reduce the term
sqr (1+2)
module Dice where
import System.Random
import System.IO.Unsafe (unsafePerformIO,unsafeInterleaveIO)
import Data.List (unfoldr)
dice4,dice6,dice8,dice10,dice12,dice20,dice666 :: [Int]
dice4 = randomRs (1,4) (read foo::StdGen)
dice6 = randomRs (1,6) (mkStdGen 5)
dice8 = randomRs (1,8)
that is exact the way, how i had learned about the state monads like IO and
Maybe.
that was even before i understood the [] monad, folding and using Random; i
don't remember when that was... ghc-5.xx age.
in my opinion, unsafePerformIO is a good learning tool, as soon as you use it
tricky to
hi!
i've just discovered this strange behaviour of existential quantifiers with
runST:
---
Prelude Control.Monad.ST :t runST (return ())
runST (return ()) :: ()
Prelude Control.Monad.ST :t runST $ (return ())
interactive:1:9:
Couldn't match expected type `forall s. ST s a'
Am Samstag, 6. Januar 2007 05:12 schrieb Brian Hurt:
Even better, if I define:
nth 0 (x:_) = Just x
nth i (_:xs) = if i 0 then Nothing else nth (i-1) xs
nth i [] = Nothing
makelist i = i `seq` i : (makelist (i+1))
nth 1000 (makelist 1)
Hi Brian.
i just like to mention another
A weird question, what does the 1 element tuple look like?
there is one in Control.Monad.Identity:
Identity 1
i miss the short version
newtype Id x = x
writing (1,) is not that well defined; how do you want to use its constructor
alone?
writing (1;) may be the solution, i think. (;) could
Comments and suggestions welcome :-)
hi Joachim.
i have some suggestions:
apache:
use fastcgi instead of hacking an own http-server.
http://www.cs.chalmers.se/~bringert/darcs/haskell-fastcgi/doc/
http://www.cs.chalmers.se/~bringert/darcs/cgi-compat/doc/
server:
there are virtual linux servers
b needs a type.
[code]
Prelude Data.Array.IArray :t array
array :: (Ix i, IArray a e) = (i, i) - [(i, e)] - a i e
Prelude Data.Array.IArray let b = array (1,33) [(i,False) | i - [1..33]] ::
Array Int Bool
Prelude Data.Array.IArray :t b
b :: Array Int Bool
Prelude Data.Array.IArray b
array (1,33)
don't :: a
don't = error D'oh!
- marc
Am Donnerstag, 9. November 2006 04:47 schrieb Donald Bruce Stewart:
As seen on #haskell, from an idea by Malcolm,
14:42 ?let top'n'tail = (pre++) . (++/pre)
14:42 lambdabot Defined.
14:43 dons L.top'n'tail foo me now
14:43
Am Dienstag, 15. August 2006 23:34 schrieb Jon Fairbairn:
On 2006-08-15 at 16:25CDT Taral wrote:
On 8/15/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:
in this case we lose class Functor a = Monad a base class
declaration. so what will be the meaning of this:
I don't see why that is
[EMAIL PROTECTED]
I'd like to hear some comments about the following ideas; maybe they are
someway obsolete or even useless nonsense.
A few days ago, I thought about abstracting the instance of an object away,
like used in Foreign.Storable.sizeOf::(Storable a)=a-Int, where only the type
of an
hi Christophe.
In terms of speed, is haskell good enough ?
in some cases, optimized haskell may even be faster than C. (that depends on
your C-programming skills. i.e. function-inlining will speed C up, too.) how
possible? look at the mangler:
(this duplicates that inquiry from glasgow-haskell-users@ to haskell@)
Am Sonntag, 6. November 2005 15:53 schrieb Hans N Beck:
Hi,
I'm searching for a good mathematical oriented introduction to the
theory of lambda calculus or other theoretical foundations of Lisp/
Haskell, i.e. monads
(this duplicates that inquiry from glasgow-haskell-users@ to haskell@)
Am Sonntag, 6. November 2005 15:53 schrieb Hans N Beck:
Hi,
I'm searching for a good mathematical oriented introduction to the
theory of lambda calculus or other theoretical foundations of Lisp/
Haskell, i.e. monads
just try to compile it with
ghc -fallow-overlapping-instances -Wall --make Main.hs
or inseart sth. like this at the first line:
{-# OPTIONS -fglasgow-exts -fffi -fallow-undecidable-instances
-fallow-overlapping-instances #-}
- marc
Am Montag, 29. August 2005 05:25 schrieb Juan Carlos
well, it is a little bit tricky.
you know, imps do not always make what you want.
imp_creates x = x `knot` imp x
where knot = (:)
imagine the following:
you pull a foulard out of your sleeve,
foulard : sleeve
where sleeve = imp_creates foulard
and pull
foulard : foulard
'.' is not always a namespace-separator like '::','.','-' in c++ or '.' in
java.
it is used as an operator, too.
(.) :: (b-c) - (a-b) - (a-c)
(f . g) x = f (g x)
remember the types of fst and snd:
fst :: (a,b)-a
snd :: (a,b)-b
so the function (.) combines
square :: Int - Int
with fst to
to all: excuse my bad english.
to javas: excuse my extreme opinions. - regard me as s.o. of an other... religion.
to newbies: read it.
to haskellers: you don't need to.
johi, Sean.
i remember that i've had the same problems with haskell, at the beginning.
you are right, that there should be a
In recent conversation with a colleague, he mentioned to me that the term
functional programming has an image problem. He suggested that the term
short komment:
meta programming and meta-language makes people curious, functional programming
seems to have the opposite effect.
merry xmas
-
main=interact id basically echoes every line of my input, whereas
main=interact show correctly waits for EOF before outputting something.
What should a student think about interact in the Prelude? (It's ok
for pipes only, I guess.)
main = interact show
behaves similar to
main = interact
Am Dienstag 16 September 2003 04:57 schrieb Yu Di:
Hi, I want to create an arrow which is essentially
data MyArrow a b = MyArrow ((String, a) - (String,b))
i.e. there is an information asscioated with each piece of data
(represented by the string), and I want
to pass it around. But I
46 matches
Mail list logo