Hello,
2007/8/16, Peter Verswyvelen [EMAIL PROTECTED]:
I wanted to do some experiments with HOpenGL, and one of the things I tried
is importing 3D models.
So I searched for a library that could do that, but besides Frag, who uses
the limited MD3 format, I did not find anything useful. Has
On Thu, 2007-08-16 at 12:50 -0700, Kim-Ee Yeoh wrote:
Aaron Denney wrote:
On 2007-08-15, Pekka Karjalainen [EMAIL PROTECTED] wrote:
A little style issue here on the side, if I may. You don't need to use
(++) to join multiline string literals.
text = If you want to have multiline
Lennart Augustsson wrote:
On 8/16/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
'Course not. The (++) function like all Haskell functions is only a
/promise/ to do its job. What does assembling at compile time
mean here:
s = I will not write infinite loops ++ s
But if the strings are all
Justin Bailey wrote:
-- Determines if the length of the strings in the list is longer than the given
-- count. If not, amount the list falls short is returned. Otherwise,
-- -1 indicates the prefix list is at least that long. If the count is zero and
-- the list is empty or just null strings, -1
It's very hard to tell if it's worth it or not. Concatenating constant
strings will turn the string into WHNF, which might enable some other
transformation. By having lots of little transformations that on their own
look worthless you can make big improvements.
I'd like to see as much static
Kim-Ee Yeoh [EMAIL PROTECTED] writes:
Aaron Denney wrote:
I find the first far more readable. The compiler should be able to
assemble it all at compile time, right?
'Course not. The (++) function like all Haskell functions is only a
/promise/ to do its job.
I find this comment
ok-4 wrote:
Someone mentioned the Blow your mind page.
One example there really caught my attention.
1234567 = (1357,246)
foldr (\a ~(x,y) - (a:y,x)) ([],[])
I've known about lazy match since an early version of the Haskell
report, but have never actually used it. Last night,
I wrote:
the compile-time/run-time dichotomy is only relevant when a
value depends on data only available at run-time.
Something I've wanted to experiment with for a long time and
never got round to is writing CAFs back to the load module
at the end of a run (if they're small enough or took a
Hi.
My plan is just add some *unusable* data to make diagonal grid normally.
Here this is.
p011_input = input ++ (transpose input) ++ diagInput ++ diagInputT
where diagInput = p011_toDiag input
diagInputT = p011_toDiag . (map reverse) $ input
input = [
If RAM was treated as an extension of non-volatile
storage instead of the other way round, we'd already
be there.
Put another way, would suspending program to
disk achieve the same results?
Jon Fairbairn wrote:
Something I've wanted to experiment with for a long time and
never got round
... I hit Chapter 3 and started reading about expressions.
*If you are able to answer any of these questions, please send me an
email. I am very lost and confused in this section, so even one
answered question may help greatly.*
I actually decided to sit down and figure out the Haskell 98
Ian,
This is all programming language parsing jargon. If the Wikipedia
doesn't help (try http://en.wikipedia.org/wiki/Formal_grammar), I
recommend the first few chapters of Aho, Sethi, Ullman's Compilers:
Principles, Techniques, and Tools aka the dragon book, or any good
book on compilers, e.g.,
On Fri, Aug 17, 2007 at 04:50:02AM -0700, Ian Duncan wrote:
So here's my list of questions so far:
1. What are nonterminals?
2. What are productions and substitutions?
[snip]
Sounds to me like you want a book on language design, grammars,
parsing, etc. :-)
There are many good ones out
Hi all.
I want to create the following polymorphic type (EnvItem) that we can apply two
functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) - String
envKey EnvItem (key, value) = key
envValue ::
On Aug 17, 2007, at 9:11 , rodrigo.bonifacio wrote:
envKey :: EnvItem (Key, a) - String
envKey EnvItem (key, value) = key
envValue :: EnvValue(Key, a) - a
envValue EnvItem (key, value) = value
But this is resulting in the error: [Constructor EnvItem must
have exactly 1 argument in
- Ursprüngliche Nachricht -
Von: rodrigo.bonifacio [EMAIL PROTECTED]
Datum: Freitag, August 17, 2007 3:11 pm
Betreff: [Haskell-cafe] Basic question
Hi all.
I want to create the following polymorphic type (EnvItem) that we
can apply two functions (envKey and envValue). I tried
Not only does you lack some parens around your patterns, your function
types are wrong :
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem a - String
envKey (EnvItem (key, value)) = key
envValue :: EnvItem a - a
envValue (EnvItem (key, value)) = value
--
Jedaï
Levi Stephen wrote:
Hi,
Apologies for a long post that may not be totally clear. I was thinking
through
a problem and how the data might be represented in Haskell. I'm now
stuck and
frustrated. Now, I'm not even sure whether I'm on the right track (I might
still be thinking too OO).
17 Aug 2007 14:44:28 +0100, Jon Fairbairn [EMAIL PROTECTED]:
Why not
data EnvItem a = EnvItem {key:: Key, value:: a}
It's the real solution, but I feel it was worthwhile to underscore the
other mistakes (often encountered by the newbies) in types and
parameters.
--
Jedaï
On 8/16/07, ok [EMAIL PROTECTED] wrote:
We're going to have to keep track of whether we have a last element
or not. The obvious candidate for this is Maybe x. Initially there
is no element, Nothing.
f x Empty = Just x
f x (Just y) = Just y
This picks up a new value (x) when there
[EMAIL PROTECTED]:~cat test.hs
import Debug.Trace
foo = foldl (\first second -
(trace ( first: ++ ( show first) ) first)
+
(trace ( second: ++ (show second) ) second) ) 0 [1,2,3]
bar = foldl (+)
traceIt x = trace (\nTraceIt:\n++show x++\n) x
[EMAIL PROTECTED]:~ghc -e foo test.hs
first:
Post the the library mailing list at [1] is the Boyer-Moore algorithm
implemented for strict and lazy bytestrings (and combinations thereof). It
finds all the overlapping instances of the pattern inside the target.
I have performance tuned it. But the performance for searching a strict
On 8/16/07, Matthew Brecknell [EMAIL PROTECTED] wrote:
However, it's possible that your use of this function is forcing
evaluation of a deeply-nested thunk you've created somewhere else (as
print does in the foldl example).
Thank you for the detailed and helpful reply. I was led to this
On 8/17/07, apfelmus [EMAIL PROTECTED] wrote:
Extracting the head and tail of ss with a let statement could lead to
a huge unevaluated expression like
rest = tail (tail (tail (...)))
Even though they are probably forced, would breaking the head and tail
apart via pattern-matching or a
or actually just...
[EMAIL PROTECTED]:~cat test.hs
import Debug.Trace
foo = foldl (\first second -
trace ( ( show first) ++ (+) ++ (show second ) )
( first + second) ) 0 [1,2,3]
[EMAIL PROTECTED]:~ghc -e foo test.hs
0+1
1+2
3+3
6
[EMAIL PROTECTED]:~
is probably better
Thomas Hartman
On 8/17/07, rodrigo.bonifacio [EMAIL PROTECTED] wrote:
Hi all.
I want to create the following polymorphic type (EnvItem) that we can
apply two functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) -
Justin Bailey wrote:
apfelmus wrote:
Extracting the head and tail of ss with a let statement could lead to
a huge unevaluated expression like
rest = tail (tail (tail (...)))
Even though they are probably forced, would breaking the head and tail
apart via pattern-matching or a case
On 8/17/07, rodrigo.bonifacio [EMAIL PROTECTED] wrote:
Hi all.
I want to create the following polymorphic type (EnvItem) that we can apply
two functions (envKey and envValue). I tried the following:
type Key = String
data EnvItem a = EnvItem (Key, a)
envKey :: EnvItem (Key, a) -
I'm trying to build the latest regex base, which is required for the other
regex packages under ghc 6.7
It complains that it can't find Data.Sequence, because it's in a hidden
module containers. I added containers to the cabal depends as can be seen
in the grep below.
And containers isn't
On Fri, Aug 17, 2007 at 02:40:33PM -0400, Thomas Hartman wrote:
I'm trying to build the latest regex base, which is required for the other
regex packages under ghc 6.7
It complains that it can't find Data.Sequence, because it's in a hidden
module containers. I added containers to the cabal
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
thanks stefan, I did remember that discussion (actually also an answer to
a question I asked.)
I got from that that previous help that I had to edit the cabal file.
The problem here, as you say, is that I had not re-run runghc Setup.hs
configure.
thanks,
thomas.
Stefan O'Rear [EMAIL
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
GHC.Prim(MutableByteArray#,RealWorld,Int#,sizeofMutableByteArray#,unsafeCoerce#)
so the fresh darcs regex tdfa
Did I find a bug cabal?
I have attempted to fix the problem
Main.c:(.text+0x22): undefined reference to `__stginit_ZCMain'
by compiling my Haskell library using the flag -no-hs-main. One would think
that this would make sense if the library is to be used by an external C
program. However I
On Fri, Aug 17, 2007 at 04:27:29PM -0400, Thomas Hartman wrote:
trying to compile regex-tdfa, I ran into another issue. (earlier I had a
cabal problem but that's resolved.)
there's a line that won't compile, neither for ghc 6.6.1 nor 6.7
import
Matthew Brecknell wrote:
The key point of the example is that foldl itself doesn't need any of
the intermediate values of the accumulator, so these just build up into
a deeply-nested unevaluated thunk. When print finally demands an
integer, the run-time pushes a stack frame for each level of
Gwern Branwen wrote:
On 0, Andrew Coppin [EMAIL PROTECTED] scribbled:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Take a look at issue 6 of The Monad Reader; search for time
On 8/17/07, Andrew Coppin [EMAIL PROTECTED] wrote:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Suppose you buy into the notion that monads sequence actions. Then
consider the following
On 8/17/07, Dan Piponi [EMAIL PROTECTED] wrote:
On 8/17/07, Andrew Coppin [EMAIL PROTECTED] wrote:
That sounds completely absurd to me... can anybody explain?
Except...you can switch on ghc's special time travel features...
On reflection I decided my example isn't very convincing. For one
Joe Buehler wrote:
What is the point in building this huge thunk if it can't be evaluated
without a stack overflow?
It's not that there's a point to it, it's just the behaviour of foldl.
Hence you shouldn't be using foldl.
GHC's strictness analyser can sometimes save you from yourself if
The HsOpenSSL package[1] is good work, but the author doesn't respond
to email(*). I've a bunch of darcs patches to add tests, DSA support
and fast Integer - BIGNUM functions. Can I use my Hackage account to
upload version 0.2 if someone else uploaded 0.1? It is reasonable?
I'm guessing that this
For a really good article to see how foldr is in fact very powerful
and how you can make it do some funny tricks, see the Monad.Reader 6th
issue :
http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf
I'll point out that you can write a lazy dropWhile with foldr in the
style of the first
2007/8/18, Chaddaï Fouché [EMAIL PROTECTED]:
For a really good article to see how foldr is in fact very powerful
and how you can make it do some funny tricks, see the Monad.Reader 6th
issue :
http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf
I just saw this was already linked in
I finally decided to actually solve the problem, and I'm sorry to say I
was on the wrong track. ListT won't do it on its own: you actually need
a custom monad that does the random pick in the bind operation.
Attached are a module to solve the problem and a Main module that tests
it. I hope
Andrew Coppin writes:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Actually, borrowing from the future - in an interpretation which is close
to my own interests - doesn't need
[EMAIL PROTECTED] wrote:
Andrew Coppin writes:
I've seen comments in various places that monads allow you to borrow
things from the future.
That sounds completely absurd to me... can anybody explain?
Actually, borrowing from the future - in an interpretation which is
close
to my own
Thanks Stefan. I got regex tdfa to compile on 6.7. FWIW, here's a patch,
generated with darcs whatsnew against a fresh unzip of regex tdfa 0.92
I didn't patch against the darcs head because this uses a language
progma in {-# options #-} in some file*, which ghc 6.7 didn't know what to
do with,
On Fri, Aug 17, 2007 at 08:13:55PM -0400, Thomas Hartman wrote:
Thanks Stefan. I got regex tdfa to compile on 6.7. FWIW, here's a patch,
generated with darcs whatsnew against a fresh unzip of regex tdfa 0.92
I didn't patch against the darcs head because this uses a language
progma in {-#
On 8/17/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
Lennart Augustsson wrote:
And as a previous poster showed, ghc does concatenate strings.
And Haskell (as in the current language definition) does not.
I was talking about Haskell.
Haskell says nothing about compile time or run time in
On 8/17/07, Kim-Ee Yeoh [EMAIL PROTECTED] wrote:
Incidentally, GHC's type checker is Turing complete. You
already have as much static evaluation as is practically possible.
You already knew that.
I don't see how the first statement implies the second.
Cheers,
Tim
--
Tim Chevalier *
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.
51 matches
Mail list logo