On 13-01-15 12:06 AM, Magicloud Magiclouds wrote:
I have enabled document in .cabal/config, so I could get document
every time I installed libraries or so.
But when I compile my own applications, it also takes time on
generating non-exist documents. How to disable it just for this project?
On 13-01-15 09:10 PM, Magicloud Magiclouds wrote:
So the only way is to use param every time I build this certain project?
Really hoping I could disable it in project.cabal
The param is for "cabal install" only. So don't use "cabal install".
cabal configure # may be skipped usually
cabal
On 13-01-16 10:04 AM, Luis Cabellos wrote:
You should read
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.22.6768
If you want to be efficient with floats. Language independent.
And also http://floating-point-gui.de/
___
Haskell-Cafe mailing
On 13-01-25 02:06 PM, Simon Michael wrote:
People have put a lot of work into regular expression libraries on
haskell. Yet it seems very few of them provide a replace/substitute
function - just regex-compat and regepr as far as I know. Why is that ?
[...]
Secondly, as of today what do y'all do
If you possess multiple instances (may be different versions, may be
same version different builds) of a package, life can be hard and
confusing. The problems are explained in my
http://www.vex.net/~trebla/haskell/sicp.xhtml
and faced by many people regularly. (Just read this mailing list.)
c
On 13-02-04 02:56 AM, Alfredo Di Napoli wrote:
Reverse engineering (aka Google searching) for Hacklab seems to reveal
that the location is Edimburgh: Correct? :D
There are many Hacklabs worldwide. But this one is Toronto, Canada. I
know because Christopher runs the Toronto Haskell Meetup and I
On 13-02-21 04:58 AM, Semyon Kholodnov wrote:
— Windows console is locked to one specific local code page, and no
codepage contains Latin-1, Cyrillic and Kanji symbols at the same
time.
Windows console is not locked to an anti-international code page; it is
only defaulted to.
Use CHCP 65001
On 13-02-21 05:18 AM, Doaitse Swierstra wrote:
I ran into the problem that for the packages which I install using
cabal install
The generated html does not contain links to the sources. This issue was raised
before in:
http://stackoverflow.com/questions/1587635/haddock-for-cabal-installed-mod
On 13-02-25 06:50 AM, Johannes Waldmann wrote:
or in general, A (and B.1) are baked into ghc,
but there is some B.2/B.3 out there which U wants to use.
Or is this what already happens? (ghc would notice
that B.1.foo is different from B.2.foo.
cabal-install would warn, but proceed?
Then the effec
On 13-03-01 05:10 AM, Malcolm Wallace wrote:
Doesn't Cabal tend to install library packages under the .cabal folder? So
blowing it away gets rid of the problematic ones. (And everything else.)
You need to perform scientific experiments to refute that claim, then see my
http://www.vex.net/~t
On 13-03-05 12:19 AM, Christopher Howard wrote:
Hi. My Haskell is (sadly) getting a bit rusty. I was wondering what
would be the most straightforward and easily followed "procedure" for
translating a recursively defined sequence into a Haskell function. For
example, this one from a homework assig
On 13-03-08 11:53 PM, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a >> return b
a `seq` return b
return (a `seq` b)
Let a = div 0 0
(or whatever pure but problematic expression you like)
On 13-03-18 09:19 AM, Jesper Särnesjö wrote:
Interestingly, running the program in GHCi with the -fno-ghci-sandbox
flag, causes it to misbehave in the same way as when compiled:
Then perhaps to mimic default ghci in hope of getting good results:
- compile with -threaded (more candidly, link wi
On 13-03-20 06:54 PM, OWP wrote:
For me personally, one thing I enjoy about a typical procedural program
is that it allows me to "Brute Force Learn".
[...]
1. I believe that you can also stare at functional programs and figure
out as much as what you can with procedural programs.
It only req
On 13-04-01 06:26 AM, Roger Mason wrote:
It turned out that there was a stale version of 'array' lurking in the
ghc package db. In spite of reinstalling ghc it did not go away until I
unregistered it. I think it was persisting because re-installing ghc
simply unpacked over the old directory lea
On 13-04-03 07:39 PM, Alexander Solla wrote:
There's your problem. Mathematicians do this specifically because it is
helpful. If anything, explicit quantifiers and their interpretations
are more complicated. People seem to naturally get how scoping works in
mathematics until they have to figur
On 13-04-04 01:07 AM, wren ng thornton wrote:
When the quantifiers are implicit, we can rely on the unique human ability
to DWIM. This is a tremendous advantage when first teaching people about
mathematical concerns from a logical perspective. However, once people
move beyond the basics of quanti
On 13-04-05 04:56 AM, Tom Ellis wrote:
"any" is very ambiguous. Doesn't the problem go away if you replace it with
"all"?
Yes, that is even better.
The world would be simple and elegant if it did things your way, and
would still be not too shabby if it did things my way, no?
«Learn You a H
On 13-04-13 12:19 AM, Daniel Díaz Casanueva wrote:
Hi cafe!
Probably you all know how to do this, but I myself found confused when
building the Haskell Platform in Linux for my first time. I was using
Linux for my first time too! The first problem I encountered was to
decide what linux packages
On 13-04-14 08:12 PM, Daniel Díaz Casanueva wrote:
By the way, a random question, what's the memory of the computer you
used to build the Platform?
I have always used my laptop with 3GB RAM. I have not measured how much
is actually needed, or what happens if I provide less.
On 13-04-14 10:22 PM, Evan Laforge wrote:
I tried to colorize a haskeline prompt by putting control characters
in it, but line editing was hopelessly confused, presumably because
haskeline doesn't understand control characters and thought the prompt
was longer than it really was.
http://trac.ha
When I was writing
http://www.vex.net/~trebla/haskell/crossroad.xhtml
I wanted to write: branching on predicates and then using selectors is
less efficient than pattern matching, since selectors repeat the tests
already done by predicates.
It is only ethical to verify this claim before writing
On 13-05-03 10:35 AM, Niklas Hambüchen wrote:
runhaskell -fno-warn-unused-matches Myfile.hs
[no output whatsoever but exit code 127]
runhaskell -fasdf Myfile.hs
[no output whatsoever but exit code 127]
$ runghc --help
Usage: runghc [runghc flags] [GHC flags] module [program args]
The rungh
On 13-05-25 04:52 PM, Daniel Díaz Casanueva wrote:
As you already know, cabal-install is configured in the file "config".
It has a lot of fields, but I didn't find a single place where each
field is explained with detail.
There is none, but my new and timely
http://www.vex.net/~trebla/haskell/
On 13-06-13 11:09 AM, Niklas Hambüchen wrote:
https://github.com/nh2/custom-hackage
An (almost trivial) script to generate 00-index.tar.gz which is
necessary to run your own `remote-repo`.
I write the following critique with much reluctance, since I will be
saying a lot of "this cannot possib
On 13-06-28 04:06 AM, Rouan van Dalen wrote:
Now when I try to install the latest version of the [time] package, I have 2
time packages, 1 in the global package db (the older version), and 1 in
the user package db
(the newer version).
Now I would like subsequent installed packages to always use
On 13-07-06 12:12 PM, Nikita Karetnikov wrote:
Is there an open sum type or a closed existential type?
OCaml has open sum types.
I haven't really seen closed existential types. (I have seen some
approximations, but each lacks one last bit.)
___
H
On 13-07-29 08:35 AM, Nikita Karetnikov wrote:
I feel that a 'myThreadId' action, which is defined in this module [1],
is useless, but I'm not sure. I think it will always return the
"Map.find: element not in the map" exception because a 'threadMap'
contains an empty 'ThreadMap'.
Is it right, o
On 13-08-06 01:14 AM, J. Stutterheim wrote:
N.B. I am _not_ proposing that we actually change the name of `return`. I do
currently have the opportunity to pick names for common functions in a
non-Haskell related project, so I was wondering if there perhaps is a better
name for `return`.
I su
On 13-08-07 01:18 AM, Mihai Maruseac wrote:
Anyway, he blogged about his problems at
http://dorinlazar.ro/haskell-platform-windows-crippled/ and I'm sure
that we can work on fixing some of them.
To learn Haskell on Windows, and with Haskell Platform already
installed, it is very easy and KISS
On 13-08-16 03:29 PM, Dan Burton wrote:
Idioms are oblivious, arrows are meticulous, monads are promiscuous
http://homepages.inf.ed.ac.uk/wadler/papers/arrows-and-idioms/arrows-and-idioms.pdf
I much recommend this paper. Underrated, underknown, pinpointing, unifying.
__
On 13-08-19 10:58 AM, Ketil Malde wrote:
b) the output isn't very helpful in tracking down the cause of this
problem, it claims that all these packages depend on array-0.4.0.1,
which is a lie. Somewhere, somehow, somethings depends on this (or at
least a newer version), but I have no clue how to
On 13-08-26 04:46 AM, Niklas Hambüchen wrote:
Effectively, sequence is a partial function.
(Note: We are not trying to obtain a lazy list of random numbers, use
any kind of streaming or the likes. We want the list in memory and use it.)
We noticed that this problem did not happen if sequence we
On 13-09-01 02:02 AM, yi lu wrote:
I have noticed if *bar* is predefined or it is a number, it can be used
as arguments. But can other strings be used this way? Like in bash, we
can use *ping 127.0.0.1* where *127.0.0.1* is an argument.
Does Bash have a rich type system, like Haskell?
Does Has
On 13-09-01 02:41 AM, Mateusz Kowalczyk wrote:
It's a bit like asking whether you can do addition everywhere by just
typing the numbers to each other (no cheating and defining number
literals as functions ;) ).
To your horror, common math language does some of that.
When 3 and ½ are typed next
On 13-09-11 07:31 AM, Obscaenvs wrote:
since the official version is a bit too TimesNewRoman-y for my
..."developed" taste.
I question that. Is it the official CSS, or is it your own browser
setting? I see no TimesNewRoman-y here.
The official version in my Firefox (Ubuntu 13.04 Desktop):
ht
On 13-09-10 09:27 PM, Thiago Negri wrote:
The package GLFW is not building in Cabal 1.18.
Setup.hs [1] depends on `rawSystemStdInOut` [2] that changed signature
between 1.16 and 1.18.
Consider "cabal install --cabal-lib-version=1.16".
Replace 1.16 by the correct number. Use "ghc-pkg list Caba
A specification language is desirable. (Test cases are special cases of
specifications. Test-driven development is a revival of the waterfall
process.) For specifying interactions (computer-computer or
computer-human), I recommend "live sequence charts" of David Harel, or
generally any one base
On 13-09-20 07:47 AM, damodar kulkarni wrote:
*Main> sqrt (10.0) ==3.1622776601683795
True
[...]
*Main> sqrt (10.0) ==3.16227766016837956435443343
True
This is not even specific to Haskell. Every language that provides
floating point and floating point equality does this.
(To date, P(provi
On 13-09-21 05:13 AM, Vlatko Basic wrote:
I'd like to extract A texts from row with header "Caption", and have
come up with this
runX $ doc
>>> (deep (hasName "tr") --
filter only TRs
>>> withTraceLevel 5 traceTree --
s
Joel Reymont wrote:
I'm trying to parse NumExpr > NumExpr (example) which should return a
logical expression while parsing numeric terms. I can't figure out how
to make buildExpressionParser do this for me since it takes the type of
the term parser given to it. If I supply a parser for numeric
Albert Y. C. Lai wrote:
However, you can make two uses of buildExpressionParser, one for numeric
expressions and the other for logical expressions. Mutual reference is
no problem since,
OK, I now see this is easier said than done in most common applications
Joel Reymont wrote:
My expression is x + 1 where x can be either "Close", or "Close[N]" or
"Close[N] of DataM where N and M are positive integers. What happens in
my case is that 1 + x parses fine but x + 1 doesn't. In fact, I would be
fine with parsing Close + such that it ignores the plus and
Neil Mitchell wrote:
Things
like laziness are cool, but are harder to convince a strict programmer
that they are useful.
Strict programmers like the "yield" command too. The same behaviour can
be obtained by laziness, with easier reasoning.
That said, strict programmers may or may not like e
I try using WordSet = [String] (plus corresponding change in code) and
get great speedup, actually way more than 3x. There was also a memory
growth phenomenon using Set String, and replacement by [String] stops
that too, now it's constant space (constant = 20M). It is possible to
attribute part
Nikolay Metchev wrote:
data Face = Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine
| Ten | Jack | Queen | King deriving (Enum, Show, Eq)
listComparator :: (Eq a) => [a] -> a -> a -> Ordering
listComparator xs a b = compare x y
where
x
Albert Y. C. Lai wrote:
I try using WordSet = [String] (plus corresponding change in code) and
get great speedup, actually way more than 3x. There was also a memory
growth phenomenon using Set String, and replacement by [String] stops
that too, now it's constant space (constant = 20M).
Tony Morris wrote:
My opposition proposed (after some "weeding out") that there is a
distinction between Excel, the application, the GUI and Excel, the
language (which we eventually agreed (I think) manifested itself as a
.xls file).
I say Excel is a functional language. If there needs to be th
Pixel wrote:
from http://pleac.sourceforge.net/pleac_haskell/numbers.html#AEN118 :
-- "read" handles both octal and hexadecimal when prefixed with 0x or 0o
-- here are versions adding the prefix and calling "read"
hex s = read ("0x" ++ s) :: Integer
oct s = read ("0o" ++ s) :: Integer
-- hex "45
A native G-machine --- physical, or chemical, or biological, but not a
repressed simulation over the imperative cpu-memory architecture --- is
the dream of every lazy-functional programmer of great devotion. If only
it became the dominant computing architecture! People would say, Haskell
is hig
There is no reality about global variables. Global variables are
syntactic sugar for local variables. That is the reality we need to
think through. This syntactic sugar streamlines many practical programs
and is indeed valuable.
___
Haskell-Cafe maili
Jules Bean wrote:
A conversation on #haskell just showed that it's quite hard to explain
(at least it is for me) to people attached to tail recursion why that is
a red herring in Haskell.
What is tail recursion?
Suppose
(1)x = f y x
A participant of the said conversation classified this
Adrian Hey wrote:
Also, I don't know if the OP was a noob, but telling people (especially
noobs) that if they can't figure out how to solve a problem without
using a "global variable" then that must be down to inexperience and
general cluelessness on their part just seems wrong to me. It simply
i
Michael T. Richter wrote:
1. A real GUI environment that takes into account some of the HID
advances made in the past 30 years. (Emacs and Vim don't count,
in other words.)
I for my life think HID refers to human input devices: keyboard, mouse,
joystick, gamepad, pedal, microph
This recent development of the thread leads me to these conclusions and
conjectures.
* If you want to demonstrate the mouse to be faster than the keyboard,
you can contrive an experiment to do so. Example: Randomize occurences
of X's in a text, ask to replace them by Y's, but make sure there i
PR Stanley wrote:
What is the rationale behind currying?
Given
map :: (a->b) -> [a]->[b]
take :: Int -> [a] -> [a]
I can write "map f . take 10" or "take 10 >>> map f".
Given
tmap :: (a->b, [a]) -> [b]
ttake :: (Int, [a]) -> [a]
I have to write "\x -> tmap(f, ttake(10, x))".
I
Grzegorz wrote:
hammingDistance [] _ = 0
hammingDistance _ [] = 0
hammingDistance (x:xs) (y:ys) | x==y = hammingDistance xs ys
| otherwise = 1 + hammingDistance xs ys
hammingDistance xs ys = h xs ys 0
where
h [] _ n = n
h _ [] n = n
h (x:
Donald Bruce Stewart wrote:
instance Num String anyone? Mwhaha
addString xs ys = add 0 xs ys
where
m = fromEnum (maxBound :: Char) + 1
alu c x y =
let s = c + fromEnum x + fromEnum y
in if s >= m then (1, s-m) else (0, s)
add c (x:xs) (y:ys) = case alu c x
Vincent Kraeutler wrote:
Donald Bruce Stewart wrote:
P.S. Have some cute code:
Control.Monad.Fix.fix ((1:) . scanl (+) 1)
either way, if one of the Masters Of The Shadow Y Style on this list
feels like throwing in another koan or two, you'll have at least one
thankful audience member ;-
Gracjan Polak wrote:
Hi,
I stumbled at some interaction of Control.Monad.State.Strict, mdo and let I do
not understand. The following program:
{-# OPTIONS_GHC -fglasgow-exts #-}
module Main where
import Control.Monad.State.Strict
thenumber :: Float
thenumber = flip execState 1.3 $ mdo
c <
Roberto Zunino wrote:
I actually misread the first one as
Control.Monad.Fix.fix ((1:) . tail . scanl (+) 1)
which is quite nice too, although
map (2^) [0..]
would be much simpler! ;-)
We apply a lesson learned from my last derivation. The lesson was to
look at s!!(n+1).
s = 1 : tail (sca
PR Stanley wrote:
The question, however, still remains: why False = 0 and True 1? I
appreciate that it's so in boolean algebra but why? Why not True = 0 and
False = 1?
A Boolean value denotees veracity whereas an ordered value concerns
magnitude (priority), indeed, order!!
Other members have
Dan Weston wrote:
Is this true? I thought do (like all sugar) was desugared before
semantic analysis. So long as you have the right >>=, return, and fail
in scope, I would have thought the desugaring is oblivious to their
definition (and particularly ignorant of instancing of the Monad
typecla
Scott Brickner wrote:
It's actually not arbitrary.
[...]
A ≤ B iff A ⊆ B
A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
Alternatively and dually but equally naturally,
A ≥ B iff A ⊆ B iff (x ∊ A) ⇒ (x ∊ B)
and then we would have False > True.
Many of you are platonists rather than formalists; you have a stro
PR Stanley wrote:
What do the ≤ symbols represent?
I see you are still stuck in ISO-8859-1 and deprived of international
characters and symbols. (And this reply in ISO-8859-1 too accordingly;
normally I use UTF-8.) Unicode and UTF-8 FTW! :)
___
Michael T. Richter wrote:
I'm tempted to quote
something about history, learning and repetition now, but won't bother
because I suspect most of the people in this mailing list know the quote
and have learned from history.
Those who have learned from history are bound to helplessly watch it
r
Justin Bailey wrote:
On 6/7/07, Grzegorz <[EMAIL PROTECTED]> wrote:
All this hard work for something that in a lesser language would be the
unimpressive: universe["Milky Way"]["Sun"] ;-P
Well, if you want to get picky there is the '!' operator defined in
Data.Map:
universe ! "Milky Way" !
Andrew Coppin wrote:
...is everybody else looking at a different web page to me? *blinks*
Everybody is interpreting it differently. (As usual.)
I see an unsafePerformIO. :)
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
Take a look at
http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
There are more elsewhere.
I am actually amazed that we have a comprehensive, widely-distributed
package for graphs and graph algorithms. I can't say the same about
other programming communities (they tend to re-imp
Andrew Coppin wrote:
But what kind of thing would you use a general graph for?
(Rather than some more specific custom data type.)
Representing networks.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/has
Hugh Perkins wrote:
> What makes a callback different from any other kind of function?
Well... what about inside monads? Does this break purity??? Does this
require adding IO to the monad if the callback function does IO?
As I'm writing this I kindof have this sense inside me that this is
Dougal Stanton wrote:
do
(hin, hout, herr, ph) <- runInteractiveProcess cmd args Nothing Nothing
forkIO $ hPutStr hin content >> hClose hin
out <- hGetContents hout
return (ph, out)
which seems to require threading. If I compile without, it will hang
indefinitely, I presume deadlocked.
Andrew Coppin wrote:
Personally, I just try to avoid *all* language extensions - mainly
because most of them are utterly incomprehensible. (But then, perhaps
that's just because they all cover extremely rare edge cases?)
Haskell is an extremely rare edge case to begin with.
Non-strict (most i
Donald Bruce Stewart wrote:
Give #haskell is a far larger community than:
#lisp
#erlang
#scheme
#ocaml
As well as
#java
#javascript
#ruby
#lua
#d
#perl6
Maybe we need to reconsider where the (FP) mainstream is now? :-)
I don't know. #math is larger th
Donald Bruce Stewart wrote:
trebla:
I don't know. #math is larger than #accounting. Is it because math is
more mainstream than accounting? I bet it is because math is more
math is more *interesting* than accounting? :-)
With all due respect to accounting, which is a fine profession and a
g
Thomas Conway wrote:
[great comments on non-strict, static typing, purely functional]
Don't worry, I was just writing a sarcasm to an apparent attitude of "X
is rare edge iff I can't figure out X". I have always been believing in
all the points you make.
__
Andrew Coppin wrote:
I stand in awe of people who actually understand what "universal" and
"existential" actually mean... To me, these are just very big words that
sound impressive.
I offer to relieve that with http://www.vex.net/~trebla/allsome.txt
I think of formal logic as clarifying thoug
http://xkcd.com/c287.html
import Data.Array
import Control.Monad
-- exactly n v
-- items in v that sum to exactly n
-- returns list of solutions, each solution list of items
exactly :: (Real a) => a -> Array Int a -> [[a]]
exactly 0 v = return []
exactly n v = do
i <- indices v
guard (v!i <=
Marc A. Ziegert wrote:
i see only two solutions.
let menu = [215, 275, 335, 355, 420, 580]
let run x menu = [[c]|c<-menu,c==x]++[c:cs|c<-menu,c
[[215,215,215,215,215,215,215],[215,355,355,580]]
You are right, I saw many solutions but they were all equivalent to just
those two. I did not avoid
Andrew Coppin wrote:
Wait... I thought Unicode was still an experimental prototype? Since
when does it work in the real world??
That myth is as old as "Haskell is an experimental prototype". "Old" as
in "that's an old one".
Windows has been well supporting Unicode since 2000. That is pretty
Paul Moore wrote:
On 10/07/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:
Interesting... I tried to put a pound sign on my web page, and it came
out garbled, so I had to replace it with "£"...
You may need to specify a "content encoding" in the HTML header. For
that, you need to know the encodin
Bryan O'Sullivan wrote:
Int is a bit of an odd fish that way; it's a
window onto the underlying machine's behaviour, not a tidy, well-behaved
mathematical ring.
I'm just being picky here: where the underlying machine's behaviour is
2's complement binary, it (Int, +, *) is actually a tidy, wel
Andrew Coppin wrote:
When I tell the editor to save UTF-8, it inserts some weird "BOM"
character at the start of the file - and thus, any attempt at
programatically processing that file instantly fails. :-(
I know Windows Notepad puts a BOM at the beginning of UTF-8 files.
http://www.vex.net/
Henning Thielemann wrote:
On Tue, 10 Jul 2007, Hugh Perkins wrote:
By the way, if you enjoy these problems, there are tons of these at
topcoder.com I cant help thinking it'd be neat to have topcoder-like
competitions for Haskell, either by pursuading topcoder to integrate support
for Haskell,
Brandon S. Allbery KF8NH wrote:
GNOME's gedit, for one, has a tendency to put byte order marks at the
beginning of every line in UTF8 mode.
Somehow I have never got a single BOM. My
http://www.vex.net/~trebla/u.html was written out by GNOME gedit.
Version 2.14.4.
Cale Gibbard wrote:
On 10/07/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:
Stefan O'Rear wrote:
> Another good example:
>
> foo :: ∀ pred : Nat → Prop . (∀ n:Nat . pred n → pred (n + 1))
> → pred 0 → ∀ n : Nat . pred n
>
x_x
> Which you can read as "For all statements about natural numbers
Derek Elkins wrote:
On Wed, 2007-07-11 at 17:10 -0700, Jeremy Shaw wrote:
At Thu, 12 Jul 2007 09:18:14 +1000,
Thomas Conway wrote:
On 7/12/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:
It's fairly common to use the Either type for this. By convention,
"Right" means "correct", and by elimination
Henning Thielemann wrote:
Since you can write Plugins for Eclipse in Haskell, things become
interesting:
http://leiffrenzel.de/eclipse/cohatoe/
Yippee! I have added an entry for it to
http://www.haskell.org/haskellwiki/Applications_and_libraries/Editors
___
[EMAIL PROTECTED] wrote:
Can we ask where there are two identical apples?
Hey, I thought about that when I was a kid! I looked at pencils and
thought "can two pencils be the same?" I concluded that they could not
occupy the same location at the same time, so there is always some small
differ
Brandon Michael Moore wrote:
Calling hClose after hGetContents is the root of the problem, but this is
a good example for understanding seq better too.
To further this end, I'll "take issue" :) with the final version that
has been tested to work, and show that it still won't work.
First, the
Tony Morris wrote:
...it seems to be a special case of Set? Does Data.Map add anything more
useful than Map' below?
Besides technical differences, beware that mere convenience makes or
breaks success of tools (languages, libraries).
___
Haskell-Cafe
Anthony Clayden wrote:
(Or at least the problem is under-specified.)
1. There may be several sub-sequences having the maximum
sum.
So the type for the solution should be :: Num a => [a] ->
[[a]]
2. The inits . tails approach adds a fault:
It introduces a sprinkling of empty sub-sequence
Dan Weston wrote:
1) Commenting out the type annotation f :: Bool makes the program hang
Turning on code optimizations (e.g., ghc -O) helps. I don't know why.
2) If I replace f = f by f = undefined, I get an annoying print of
"LazyOr: Prelude.undefined" before it returns the correct value.
brad clawsie wrote:
i am having a problem with hxt, i was wondering if anyone here has
experience with it. in particular, i find that the xread function
chokes on xml files with xml declarations, and i am not sure why.
[...]
This is intended. Generally, wherever the HXT manual says "content"
(
Andrew Coppin wrote:
> 0^2
0
> (0 :+ 0)^2
0 :+ 0
> 0**2
0
> (0 :+ 0)**2
NaN :+ NaN
There is nothing wrong AFAIK. (How much do I know? BSc in math, went
through classes on real analysis and complex analysis.)
There is no reason to expect complex ** to agree with real **.
Real x**y is
rodrigo.bonifacio wrote:
owner :: Step -> Scenario
owner (Step id scenario action state response) = scenario
Is it possible to define the owner function in such way that I can write
x.owner (returning the scenario related with the Step x)?
The . is already taken. Choose some other symbol, sa
Dan Weston wrote:
I hate to be a party pooper, but isn't this just:
> f = foldr (\a z -> (a:snd z,fst z)) ([],[])
This takes less time to grok and takes no longer to run.
For each type with exported constructors, one can always write
deconstructors for it, if not already found in libraries.
apfelmus wrote:
Hugh Perkins wrote:
Arguably there are two possible implementations, one that enforces
one-to-one mapping, and one which allows multiple values, in either
direction.
Terminology reminder :)
- the latter is called "(binary) relation"
http://en.wikipedia.org/wiki/Binary_relatio
Andrew Coppin wrote:
...does this mean Haskell is officially harder to understand than Lisp,
Java, Perl and O'Caml? :-}
(OTOH, does this mean Haskell is easier to understand than PHP or C++?)
Or, Haskell is the easiest to understand of them all.
Reason: Extremely large channel means so hard
Neil Mitchell wrote:
Other rules that could be interesting are:
> forall a b. fromInteger a + fromInteger b = fromInteger (a + b)
> forall a b. fromInteger a * fromInteger b = fromInteger (a * b)
This is wrong, since the class function can do what it wants. Imagine:
instance Num String where
1 - 100 of 367 matches
Mail list logo