.
The strictness analyzer likes Udo more than Niko, does it?
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
on
(perhaps in a different module), things will break.
The flexibility comes at a price: Gofer's type class system was unsound
and I don't know how much Hugs comes close to this.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http
14:43 dons yes!
14:44 pkhuong- mm. the opposite of do, eh? do for comonads? :)
So now a prize to the person who comes up with the best use for the
identifier:
don't :: ?
-- Don
don't :: IO a - a
example :: ()
example = don't (do erase /dev/hda)
Regards,
apfelmus
depending on s.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
#When_can_I_rely_on_full_laziness.3F
I think the reason given there is wrong, it's not about efficiency but
about space leaks. The map showcase suggests that (map (`elem` tags)
cols) is computed only once, though personally, I don't rely on that (yet).
Regards,
apfelmus
appear on the
lhs of a let or a lambda. In the definition of f above, (f :: Int -
Int) and (x+1 :: a) are judgments and (f :: a - a) is a variable
binding. Any confusion between judgment and binding is just like a
confusion between constructor application and pattern.
Regards,
apfelmus
not gain additional clarity.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
space time= (inject sf) . (inject sf')
and the same for all other operations you provide besides `o`.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Paul Hudak wrote:
In fact avoiding space leaks was one of the motivations for our moving
to an arrow framework for FRP (now called Yampa). Arrows amount to a
point-free coding style, although with arrow syntax the cumbersomeness
of programming in that style is largely alleviated.
I think
be constructed by hand in plain Haskell.
To apply this to Ints, one should view them as
type Int = [Digit]
data Digit = Zero | One
Also note that there is absolutely no balancing involved (which would
break infinite and lazy stuff).
Regards,
apfelmus
The (almost) point-free versions run faster than my fast
imperative version and take up significantly less heap space-- even
the version which reads everything and then writes takes up about 1/3
the heap space as my version.
That was not intended, though I'm very pleased :-D
I get the
be interleaved lazily, this has to be
simulated with appendFile. We can read files lazily but we cannot output
them lazily.
Can this be remedied? Can there be a version of writeFile which is, in a
sense, dual to getContents?
Regards,
apfelmus
___
Haskell-Cafe
)
Just v' - (k', v') : tail
where v' = bestKey k (key x)
should be (?) where k' = bestKey k (key x)
| otherwise = (k, v) : (myFunction tail x)
Regards,
apfelmus
) is a pure function.
I think some kind of lazy writeFile could allow this.
thanks for your help,
No problem. :)
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
-rounding Finger Tree, see also
Finger Trees: A Simple General-purpose Data Structure
Ralf Hinze and Ross Paterson.
in Journal of Functional Programming16:2 (2006), pages 197-217
http://www.soi.city.ac.uk/~ross/papers/FingerTree.pdf
Regards,
apfelmus
proposed by Löh and
Hinze
http://www.informatik.uni-bonn.de/~ralf/publications/OpenDatatypes.pdf
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
because the
latter would in principle allow to supply different dictionaries for one
and the same type.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
as unfoldr
iterate f x0 = unfoldr g x0
where g x = let x' = f x in Just (x',x')
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
are *the* natural data structure for (in)finite maps
in functional languages, see also
Ralf Hinze. Generalizing generalized tries. Journal of Functional
Programming, 10(4):327-351, July 2000
http://www.informatik.uni-bonn.de/~ralf/publications/GGTries.ps.gz
Regards,
apfelmus
.
Indeed, the above shows the subtle difference: with type classes, one
may not pass an undefined dictionary as this is an unresolved
overloading. Irrefutable patterns for existential types somehow disturb
things.
Regards,
apfelmus
___
Haskell-Cafe
in ((a, b:bs) : rs, m')
To summarize, the problem can be solved without irrefutable patterns for
GADTs: the code above works for infinite lists. Yet, they are handy and
can be introduced safely in the case where the type indices are known in
advance and no type refinement happens.
Regards,
apfelmus
, strictness is not
absolutely necessary (see upcoming mail on this thread).
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
falls into the more haste, less speed category) while
staying more type safe.
@Conor: how does this issue look like in Epigram?
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
safe _|_
instead of a nasty unsafe segfault?
I agree. The only practical problem I can imagine is that GHC internally
treats existentials as GADTs.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman
Ross Paterson wrote:
The story so far:
apfelmus: why are there no irrefutable patterns for GADTs?
Conor: because you could use them to write unsafeCoerce
Ross: how about irrefutable patterns (or newtypes) for existential types?
Simon: Try giving the translation into System F + (existential
a))
is the best type for insertdelete. Here, it is clear that insertdelete
likely can do a fast uninsert.
Btw, why are there no irrefutable patterns for GADTs? I mean, such a sin
should be shame for a non-strict language...
Regards,
apfelmus
___
Haskell-Cafe
on, but otherwise, for this
special splitSeq-problem, one runs into the more haste less speed
dilemma (i mean Wadler's paper ). Bertram's lazy algorithm actually is
an online-algorithm and it should remain one when making it type safe.
Regards,
apfelmus
___
Haskell
on the map'. uninsert does not
have information about the single steps that have been done, it only
knows what should come out. From that, it would have to reconstruct
quickly what happened, if it wants to be fast.
Regards,
apfelmus
___
Haskell-Cafe mailing
to wait on them.
Also, if your argument would have been correct, then the version without
balancing wouldn't work either because insert already exchanges Leafs
for Nodes in m. So the top of the map would be unavailable until all
Leafs have been exchanged.
Regards,
apfelmus
Bulat Ziganshin wrote:
because REAL code is somewhat larger than examples. try to rewrite the
following:
directory_blocks - (`mapM` splitBy (opt_group_dir command)
files_to_archive)
( \filesInOneDirectory - do
datablocks - (`mapM` splitToSolidBlocks filesInOneDirectory)
) a map
map'=
(if Map.member a map then id else Map.insert a (sz+1)) map
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
a bimap then id else insert a (sz+1)) bimap
Note that update actually generates fresh constructors, so the structure
of our tails-Imp is not really static. But this is no problem as the
form of the constructors is completely known: there is only one.
Regards,
apfelmus
,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
x) can be implemented as follows:
evaluate x = catch (x `seq` return x) throw
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
a) is not _|_, but does throw an exception
when executed. The appended code shows the differences.
Regards,
apfelmus
import Prelude hiding (return,catch)
import qualified Control.Monad as M
import Control.Exception
a = undefined :: ()
return = M.return :: a - IO a
e 0 = return a
e 1 = a `seq
to be void of the intended meaning.
Regards,
apfelmus
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Haskell challenge is of course the ICFP contest
http://icfpcontest.org/
There is also the International ACM Programming Contest
http://acm.uva.es/problemset/
Your country surely has some kind of high school computing science
competition to get problems from.
Regards,
apfelmus
801 - 837 of 837 matches
Mail list logo