Loading package OpenGL-2.2.1 ... linking ... done.
Loading package GLUT-2.1.1 ... linking ... done.
The above message was after you have installed GLUT-2.0, but GHC was
still loading GLUT-2.1.1. The later errors were caused by your forced
copy of 2.0 lib over the default 2.1.1.
I noticed
| It seems that GHCi outputs the contents of the variable you've created
| when there's only one of them.
Indeed, that is documented behaviour (first bullet here:
http://www.haskell.org/ghc/docs/latest/html/users_guide/ch03s04.html#ghci-stmts
)
Perhaps it's confusing behaviour? If so do suggest
I thought the master plan was that less would come with the compiler /
interpreter and the user would install packages using cabal.
Ideally, yes. I think a useful model would be GNU/Linux, where there is
the Linux kernel, developed by core hackers, and then there are
distributions, which
http://www.haskell.org/HOpenGL/
First, the bad news: The HOpenGL site is outdated. Look at [1] and
note the date of the most recent release: September 9, *2003*.
[1] http://www.haskell.org/HOpenGL/releases.html
try http://www.haskell.org/haskellwiki/Opengl ?
[Sven: could there please be a
[cc-ed to haskell@, as this discussion is about [EMAIL PROTECTED]
There are four things sent to the haskell list@
1) Calls for papers
2) Annoucements
3) Oleg's stuff (which are really announcements of a library or technique)
4) Off topic stuff
I'm initially only proposing to mop up category
return (repeat 'a') = \ x - print $ span (const True) x
with hugs you will get a stack error, in ghc it executes in constant space,
i.e. indefinitely. In essenece the above example does exactly the same as my
ealier code.
this thread might be relevant:
in other words, people were meant to subscribe either
to haskell or to haskell+haskell-cafe, and posting to
haskell was meant to be a flag able to raise a topic
briefly over the general din in haskell-cafe.
Do people think that is working?
i don't think it is working anymore. haskell-cafe
afraid not
the given example is too strict, the requirement is to generate the matched
portion lazilly, and return the tail (unconsumed portion).
ah yes, without optimisations, Prelude.span builds up stack,
while the continuation-based alternative i mentioned is too
strict for some uses.
In
return (replicate 100 'a') = \x-print $ spant (const True) x
ERROR - Garbage collection fails to reclaim sufficient space
i.e. as the function unfold, the thunk representing the second term builds
up on the heap.
true. i've often wanted a copy pseudo-function that would
avoid updating
return (replicate 100 'a') = \x-print $ spant (const True) x
ERROR - Garbage collection fails to reclaim sufficient space
i.e. as the function unfold, the thunk representing the second term builds
up on the heap. (not sure why it works for an infinite list, hugs must drop
the reference to
This is why I found it so surprising - and annoying - that you can't use
a 2-argument function in a point-free expression.
For example, zipWith (*) expects two arguments, and yet
sum . zipWith (*)
fails to type-check. You just instead write
\xs ys - sum $ zipWith(*) xs ys
which works as
== intro
no, i'm not talking about using a nice frontend to ghci, with added
functionality, although the haskell modes for emacs and vim, and
other such gui/ide/editor efforts, are well worth looking into!-)
also, i'm not going to talk about the eagerly anticipated ghci debugger.
what i am
since this doesn't seem to want to go away:-)
1. reverse psychology approach
if you have reached this page following rumours of a language
others told you every serious programmer would have to learn,
the ministry of programming would like to reassure you that
there is no such
most widely-used programs (ex: web browsers, word processors, email
programs, data bases, IDEs) tend to be 90% IO and 10% (or less) computation.
This can make Haskell quite unweildy for solving these types of problems.
On the otherhand, writing something like a compiler (which requires a small
but calling split-base base goes directly against all basic
assumptions of all packages depending on base.
The new base will have a new version number. There is no expectation of
compatibility when the major version is bumped; but we do have an informal
convention that minor version bumps
You need a way to specify foo 1.2 foo 2, which is a
suggestion that was tossed around here recently.
but what does such a version range say? that i haven't tested any
versions outside the range (because they didn't exist when i wrote
my package)? or that i have, and know that later
but the name that is everywhere does not stand for what the new version
provides! any place that is currently referring to 'base' will have to be
inspected to check whether it will or will not work with the reduced
base package. and any place that is known to work with the new
base package
However, I'd like to separate it from Cabal. Cabal provides mechanism not
policy, regarding version numbers.
but the examples in the cabal docs should reflect the standard
interpretation of version numbers.
of course, i have absolutely no idea how to write stable packages under
this
Be happy: we're about 15 years ahead of the lisp guys. 'cabal install
xmonad' works, for example.
- not on windows (and since it is popular, it will seduce more
good haskellers not to bother with windows compatibility.. :-(
- from xmonad.cabal (version 0.3, from hackage):
build-depends:
- if you provide a 'base' configuration that pulls in the stuff that
used to be in base, the package will work
I don't know of a way to do that. The name of the package is baked into
the object files at compile time, so you can't use the same compiled module
in more than one package.
1. Document the version numbering policy.
agreed. just making everybody's interpretation explicit has
already exposed subtle differences, so documenting common
ground will help.
We should have done this earlier, but we didn't. The proposed policy, for
the sake of completeness is: x.y where:
If the convention for modifying package versions of form x.y.z is:
- increment z for bugfixes/changes that don't alter the interface
- increment y for changes that consist solely of additions to the interface,
parts of the interface may be marked as deprecated
- increment x for changes that
I have another concrete proposal to avoid things breaking so often. Let us
steal from something that works: shared library versioning on unixy systems.
indeed!-) there are established workarounds that are needed to
make that system work as it does, so it is a good idea to check
whether cabal
are those tricks necessary in this specific case? couldn't we
have a list/range of versions in the version: field, and let cabal
handle the details?
I don't understand what you're proposing here. Surely just writing
version: 1.0, 2.0
isn't enough - you need to say what the 1.0 and 2.0 APIs
the idea was for the cabal file to specify a single provided api,
but to register that as sufficient for a list of dependency numbers.
so the package would implement the latest api, but could be used
by clients expecting either the old or the new api.
I don't see how that could work. If the
if that is your definition of compatible, you can never throw any
packages away
Is this a problem?
apparently, yes. no two versions of base with ghc, only the
newest set of core packages with each ghc release. and how
much time do you want to spend on finding, re-building, and
re-installing
Which reminds me that it would be nice to be able to ask for a list
of what imports I need to specify (i.e. what names from the module
are actually used). A case in point would be the example of non-
monadic I/O I sent to the list the other day: I wanted to specify
minimal imports, but
These two cases could be solved by re-exports, no extra mechanism is required.
yes, good support for re-export would be nice to have. the
reason it has so many applications is that it is a way to explain
connections between providers, apis, and clients to the package
manager.
- consider
Incedentally, this reminds me that GHC should have a warning for not using
explicit import lists (perhaps only for external package imports).
for package-level imports/exports, that sounds useful.
claus
___
Haskell-Cafe mailing list
It has been noted in a few places that the 2 line quicksort demo in the
Introduction section of the haskell wiki
http://www.haskell.org/haskellwiki/Introduction
isn't a real quicksort, and wouldn't scale well with longer lists.
Interested, and wanting to put my recently learned test data
Hi Mark,
Declaration Formula
--- ---
class Eq a = Ord a forall a. Ord a = Eq a
instance Eq a = Eq [a] forall a. Eq a = Eq [a]
class C a b | a - b forall a, b. C a b /\ C a c = b = c
This correspondence between declarations and
From my point of view, the difference between 0b10111011 and
(bin[1,0,1,1,1,0,1,1]) is 22-10 that is 12 characters.
how about using ghc's new overloaded strings for this?
10111011::Binary
there used to be a way to link to ghc head's docs, but
i can't find it right now. the test is
For technical reasons, GHCi can only support the *-form for modules
which are interpreted, so compiled modules and package modules can
only contribute their exports to the current scope. But it does mean
the interpreter isn't referentially transparent, which is weird for a
language that puts so
Granted, I'm lazy. I read release notes only and only few first pages
to see what's new. Couldn't GHCI be improved to at least give some
hints?
it does!-) watch the prompt, which says '*M', if all of M's top-level
is in scope, or 'M', if only M's exports are in scope. check here:
Is there any plugin system for haskell? For example, in Java, I can
load all compiled classes from given directory, check their interfaces
and run some methods through reflection etc. Is it possible in
haskell, to load modules from given directory, and if in module there
is instance of class
hi,
with the large number of just chatting messages on
haskell-cafe, it is all too easy to miss problem reports
here. you might have a better chance asking on more
specific lists, eg. for ghc use, or library issues
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
if you want to make something like this for haskell (and
i'd very much like to use it!-), there are several issues,
including:
1 handling code:
- going for a portable intermediate representation,
such as bytecode, is most promising, especially
if the code representation is
Maybe hardened Haskell programmers don't notice these things, but
there's a wall that goes up when Haskell is presented to
non-functional programmers. There are significant barriers for them to
cross (some of them imaginary): there's the infamous type system,
there's the mystique around monads,
The approach is so simple and trivial that it must have occurred to
people a hundred times over. Yet I do not find any other examples of
this. Whenever I google for church encoding the examples don't go beyond
church numerals.
Am I googling for the wrong keywords?
You might find Typing
If I have a problem where I have to select from a set of operations,
how
would I print the result?
Example: If I can chose from (x+y), (x*y), (x^2+y)...
and I feed them all into my problem solver
and it finds that (x*y) is right, how can I print that string?
As others have pointed out,
Thanks Stephen--that was related to my original question, about using HP
with Cygwin. The answer seems to be No!--you must use MSYS (for real
work).
The short version:
- Cygwin provides commandline tools, compilers and libraries
- MSYS provides commandline tools for the MinGW compilers and
of
the Haskell tools won't work when launched from Cygwin Bash.
Chris
-Original Message-
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Claus Reinke
Sent: 08 June 2010 09:02
To: haskell-cafe@haskell.org
Subject: Re: [Haskell-cafe] HP/Cygwin and Curl
As others have pointed out, you can't go from operation to
representation,
but you can pair operations and expressions with their representations.
This idea is also implemented in my little 'repr' package:
http://hackage.haskell.org/package/repr
And probably more completely/comfortably!-)
..ghci is able to generate the tagsfiles for you. This allows you to
jump to definitions of identifiers.
If you go this route, I will shamelessly promote hothasktags instead
of ghci. It generates proper tags for qualified imports.
What do you mean by proper here? GHCi has the information
I'll work with Simon to investigate the runtime, but would welcome any
ideas on further speeding up cafe4.
Just a wild guess, but those foldWithKeys make me nervous.
The result is strict, the step function tries to be strict, but if
you look at the code for Data.IntMap.foldr, it doesn't really
If you want to use cool languages, you may have to get a cool job. I
know: it's easy to say and harder to accomplish.
Most functional languages (e.g. Lisp, Haskell, ...) have a challenging
time in industry since they require some savvy with multiple levels of
higher abstractions and some
If you go this route, I will shamelessly promote hothasktags instead
of ghci. It generates proper tags for qualified imports.
What do you mean by proper here?
I think Luke means that if you use qualified names then hothasktags can
give you better location information than current ghci ctags.
I have below duplicate code, but i don't know how to use TH instance code.
-- duplicate code start
--
instance Variable PageType where
toVariant = toVariant . show
fromVariant x = fmap (\v - read v :: PageType) $ fromVariant x
If
I'm interested in situations where you think fundeps work
and type families don't. Reason: no one knows how to make
fundeps work cleanly with local type constraints (such as GADTs).
If you think you have such as case, do send me a test case.
Do you have a wiki page somewhere collecting
This seems like an example of list-chauvinism -- what Chris Okasaki
calls a communal blind spot of the FP community in Breadth-First
Numbering: Lessons from a Small Exercise in Algorithm Design --
http://www.eecs.usma.edu/webs/people/okasaki/icfp00.ps
Thanks for sharing; this was an
I'll work with Simon to investigate the runtime, but would welcome any
ideas on further speeding up cafe4.
An update on this: with the help of Alex I tracked down the problem (an
integer overflow bug in GHC's memory allocator), and his program now
runs to completion.
So this was about
Claus -- cafe5 is pretty much where it's at. You're right, the proggy
was used as the bug finder, actually at cafe3, still using ByteString.
It would be useful to have a really tiny data source - no more than
100 entries per Map should be sufficient to confirm or reject hunches
about
class C a b | a-b where
op :: a - b
instance C Int Bool where
op n = n0
data T a where
T1 :: T a
T2 :: T Int
-- Does this typecheck?
f :: C a b = T a - Bool
f T1 = True
f T2 = op 3
The function f should typecheck because inside the T2 branch we know
that
f :: forall a b. C a b = T a - Bool
f T1 = True
f T2 = (op :: a - b) 3
as that results in the counter-intuitive
Couldn't match expected type `Bool' against inferred type `b'
`b' is a rigid type variable bound by
the type signature for `f'
at
Prelude :t id :: Eq b = b - b
id :: Eq b = b - b :: (Eq b) = b - b
Prelude id :: Eq b = b - b
interactive:1:0:
No instance for (Show (b - b))
arising from a use of `print' at interactive:1:0-19
Possible fix: add an instance declaration for (Show (b - b))
In a stmt of a
Most languages today provide a certain glue to bring everything
together.
Most languages today provide several kinds of glue and, while some
of those kinds are not recommended, Haskell unfortunately doesn't
provide all useful kinds of glue. Especially the module system is a
weak point: in SML,
I am making use of the Data.Array.Repa module to achieve data-parallelism.
On running my program I get the error:
thread blocked indefinitely on an MVar operation
Haven't seen any responses yet, so here are some suggestions:
Two questions:
1. What could be some of the potential causes for
One of the problems is that the anchors that Haddock
currently generate aren't always legal in HTML, XHTML,
or XML. I'd like to fix the anchor generation so that they
are. If I do, then links between old and new generated
Haddock pages will land on the right page, but won't
always get to the
scientists, who ought to know,
assure us that it must be so,
oh, let us never, never, doubt,
what nobody is sure about.
(or something like that..;-)
as everyone else in this thread, I have my own experiences and
firm opinions on the state of debugging support in Haskell (in
particular on the
thinking helps, but claiming that tools can't help doesn't.
Lets be absolutely clear about this: I've never claimed that
tools can't help. In this thread I've been using the term
debugger in the narrow sense implied by the OP's question --
something that steps through the execution of the
don't know whether this is useful/related, but
- I got a whole bunch of very old haskell.org emails today
(so they must have been hung up somewhere)
- some of the ghc trac tickets look bogus, filled with links
(#889, sent 05 Sept, received today, 26 Sept;
#751, sent 05 Sept, received
This is a follow-up to a thread from June-July[1]. The question was how to
write the function
initlast :: [a] - ([a], a)
initlast xs = (init xs, last xs)
so that it can be consumed in fixed space:
main = print $ case initlast [0..10] of
(init, last) -
by all means, lets have warm fuzzy precedence declarations
infix(nearly right) (exp (2*i*pi) + 1) :-)
infix(mostly left) (((\x-cos x + i*(sin x)) (2*pi)) + 1) (-:
who says that all the fun has to start in the type system?-)
we would probably need to refer to hyperreals, in order to
not a solution to your problem, but covers all your tests,
as well as one more that would inevitably have followed:-)
cheers,
claus
Twice.hs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
This isn't a trivial point. We know that error handling code is a major part of software cost--it
can even dominate the cost of the correct case code (by a large factor). Erlang's program for
the correct case strategy, coupled with good fault tolerance mechanisms, is one reason for its
Couldn't we just use rewrite rules to rewrite *transparently*
all uses of fromJust to safeFromJust, tagging the call site
with a location?
..
Looks good! But that is deceiving: the assert was expanded before the rule
fired, and refers to the rewrite rule source line (line 19), not the
this thread reminds me about something that I wanted to ask you.
if I recall correctly, most of the literature references in STM papers
are recent, so I wondered whether you are aware of this one:
NAMING AND SYNCHRONIZATION IN A
DECENTRALIZED COMPUTER SYSTEM
SourceTechnical Report:
In fact it turned out that the example code I posted did not exhibit the
memory leak at all. It just took a /very long time/ to complete
(compared to a Java version), but it did complete. My complete code,
which also counted the instances of a given number from the array, does
however exhibit the
also on the multi-version approach. but the particular reason I mentioned this
was
that it also tried to address the issue of composing transactions (discussion
of which
is explicitly excluded from the section 1.2 you refer to). for instance,
compare the
discussion and examples in Composable
something like the attached vim script might work for small sources
(ignores all layout rules and keywords, just records increase/decrease
of indentation stack; builds up a rather large pattern of positions for
highlighting via :match).
(don't assume that this is the only, let alone the right
Hello yourself!-)
Two days ago I have found Haskell in Internet. It sounds very nice.
I have read some articles, few examples, ... yes it sounds nice.
you need to try it as well. haskell.org has information, tutorials,
interactive implementations (and to answer the likely follow-on question:
if you're using Haskell at all, you *are* the Haskell community.
[..lots of I searched, I found, I tried, I got this error, I thought,
I tried this workaround, I got to this point, now I'm stuck here..]
I just wanted to comment that I find this kind of experience report
very helpful,
We have made a number of assumptions which Paul exposed:
- users should know to do darcs get, then runhaskell Setup.hs
configure/build/install
- users should know to look for Haddock docs
- users should know how to look for and install dependent libraries
(Cabal-1.1.6.1, in this case)
and there
absolutely, this has occurred to me too. There should be a stanard Cabal
README file, and Don's mkcabal tool could drop it in the tree.
This occurred to me too. My current plan for mkcabal is that it creates:
foo.cabal
Setup.lhs
README
LICENSE
based on a series of interactive
Maybe we can claim it should be 'has kell', where kell is something
cool, and no cornflakes. It has kell.
if there was an implementation of Haskell on Cell processors, it could
be has cell.. I wonder if knowing what people are going to do with
your name is sufficient to put students off
The reason why Haskell is academic-centric is that it was originally
conceived by academics, and they were interested in doing research
into language design and implementation ..
shouldn't we make this used to be academic-centric?
People outside academia who might be inclined to take on some
well, if Sun hadn't have released a version of smalltalk with a funny
c like syntax, you might have seen some interesting developments in
the mid 90's
yes, perhaps. but now that funny smalltalk is open source, the self
team has been released from indenture (after Scheme and Self
people, Sun is
+1 . I would love to read something that is the equivalent of 'design
patterns', but for functional languages.. I want to learn how to think
functionally.
If you want to learn how to think functionally, forget you ever
heard the words design pattern. There shouldn't be patterns in your
[EMAIL PROTECTED]:
Bulat Ziganshin [EMAIL PROTECTED] wrote:
tphyahoo wrote:
*UnixTools explodeLambda( map (*) [1,2] )
[(\x - 1*x),(\x - 2*x)]
Have a play with this, from Claus Reinke:
http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/R.hs
Regards,
Malcolm
while (hGetBuf h buf bufsize == bufsize)
crc := updateCrc crc buf bufsize
break if crc==0
print crc
inContT $ callCC $ \break - do
flip execStateT 0 $ do
whileM (liftM (== bufsize) (hGetBuf h buf bufsize)) $ do
modifyM (updateCrc buf bufsize)
while (hGetBuf h buf bufzise .==. (return bufsize)) $ do
crc =: updateCrc crc buf bufsize
breakIf ((val crc) .==. (return 0)) `orElse` do
printM (val crc)
od
your solution is just to make lifted copy of each and every pure
operation. so one should define 2^n
pad causes a stack overflow and pad1 uses up about 6m of heap.
pad1 xs =
xs ++ [0x80] ++ ps
where
l = length xs
pl = (64-(l+9)) `mod` 64
ps = replicate pl 0x00
wild guess: if you compute the length when the consumer reaches ps,
you hold on to a copy of xs longer than needed,
Adding seq ruins eta reduction. For normal order lambda calculus
we have '\x.f x = f' (x not free in f). If we add seq this is no longer true.
isn't that a problem of seq (and evaluation in Haskell generally) not being
strict enough (ie, forcing evaluation only to weak head normal form
in structural operational semantics, an evaluation context is often used to
decompose an expression into a redex and its context. In a formal semantics on
paper, an expression can just be pattern matched over the grammar of an
evaluation context. If one wants to implement such a semantics in
-- evaluation contexts, parameterized by rule to apply
ctxt rule e = rule e `mplus` left (ctxt rule) e `mplus` right (ctxt rule) e
left act e = do { (Plus l r) - return e; lv - act l; return (Plus
lv r) }
right act e = do { (Plus lv@(Val _) r) - return e; rv - act r; return (Plus
lv
So, as I understand, choosing default laziness was just experimental design decision in order to
answer the question: how good lazy language can be. I am practically convinced, that lazy
evaluation included in the _right_ places can be extremely useful. I didn't state the question as
strict vs
i have to say that i find the folklore sieve quite acceptable as a sieve, whereas
the faster test-against-primes is obviously different. but the discussion has
prompted me to write yet another sieve, perhaps more acceptable to purists.
instead of using (mod p) repeatedly and filtering
Algorithm 10^310^4 10^5 10^6 10^7 10^8
Reinke0.04 1.2141.00- - -
- Reinke is the ``applyAt'' algorithm Claus Reinke posted here
while I'm not unhappy that this code is performing reasonably well, it was
mostly an attempt to get
This isn't a variant of the folklore sieve, it's actually the real one!
:-)
well, one thing i was trying for (and what perhaps one might like to see in a
paper), is a way of relating the various code alternatives to each other, with
suitably similar intermediate stages. not quite as detailed
I hoped at least to stimulate interest in repeating GP experiment with latest GHC version.
until that happens, I'd be wary to draw too many conclusions for today's
applications from this paper. two orders of magnitude difference would seem
to imply programming problems to me (though the
It'd be interesting to get the real code for this. Partly to just try
optimising it but more so as a real test case for list/array fusion.
As far as I see, there's no reason that consuming an assoc list of a
bool vector with a foldl' (the ' is probably essential) should be slow.
If it's fused
Melissa, thank you for taking my comments as constructively as they were meant.
and not to worry, i'm sure i'm not the only one who enjoyed this little
exercise and
learned a lot from it!-) and even if we've found more that you expected, you're
quite
right, one doesn't get anywhere unless
The main example of course is ByteString fusion as presented in our recent
paper:
http://www.cse.unsw.edu.au/~dons/papers/CSL06.html
btw, why did you restrict yourself to improving [Char], rather than [a]?
naively, it would seem to me that most of the framework should work
just as well for
http://docs.haskell.org/Data.Map.funcname
this reminded me that haddock has long generated files with paths and relative urls
that allow you to do that kind of thing, if slightly cryptically, and that i have long
wanted to access the local haddocs from vim. since i'm a bit slow learning about
Again, the problem with this script is that it requires you know the
package name for the function you're looking up. I see this as an
over-burdenous requirement on the user.
okay. sometimes i know/guess the module i'm looking for, but not the item.
sometimes i recall the item i'm looking for,
If someone knows of a simple way to generate a function/type list of
the standard modules, I'd love to hear about it. Generating such a
list on the fly each time is probably not an option, as it would be
too slow.
Using a recent version of haddock, the --hoogle flag gives you exactly
what you
I think I could have most of the oneliner goodness of h4sh, without having to do
the module install, if I could figure out a way to include modules with ghc -e.
i confess myself to be among those who underappreciated ghc -e, until this
thread:)
as Joachim said (thanks for starting this,
[cc-ed to hopengl list; are there many haskell opengl users
not on that list, btw?]
a standard package for easy-to-use, high-quality, portable
font support would make a great addition to haskell's
otherwise nice opengl bindings!
is there a reason for going directly to freetype? from the
old
About 7 years ago such a tool existed:
http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/GHood/
GHood was never intended to visualize graph reduction
directly (*). instead, it visualized observations - ie, you
could see if and when which parts of an observed data
structure was
type family F a :: * - *
..
We made the design
choice that type functions with a higher-kinded result type must be
injective with respect to the additional paramters. I.e. in your case:
F x y ~ F u v = F x ~ F u /\ y ~ v
i'm still trying to understand this remark:
- if we are talking
1 - 100 of 545 matches
Mail list logo