Don Stewart <[EMAIL PROTECTED]> writes:
>>> splitAt n xs = (take n xs, drop n xs)
>> Thanks. That is odd, though. It makes me wonder what to expect re
>> optimization. Would the compiler/runtime know that splitAt could be
>> done in a single pass?
> Not with that definition. It would requ
On Fri, 4 Jul 2008 15:43:38 -0400, "John D. Ramsdell"
<[EMAIL PROTECTED]> wrote:
>My son's nickname is Rama, so let me adopt it. I am a functional
>programmer, even when I use languages such as C. Scheme facilitated
>my development into a functional programmer, however, I appreciate the
>benefit
Alexey Rodriguez:
On Fri, Jul 4, 2008 at 5:03 AM, Manuel M T Chakravarty <[EMAIL PROTECTED]
> wrote:
The problem is that blah's type is ambiguous, as f does only occur
as an argument to the type family. If you'd define
class Blah f a where
blah :: a -> f -> T f f a
(and change the r
Quoth "Ken Takusagawa" <[EMAIL PROTECTED]>:
| $ ghc --make test-hopenssl.hs -lcrypto
| [1 of 1] Compiling Main ( test-hopenssl.hs, test-hopenssl.o )
| Linking test-hopenssl ...
| /tmp/ken/lib/hopenssl-1.0/ghc-6.8.2/libHShopenssl-1.0.a(Digest.o): In
| function `s2O8_info':
| (.text+0xf
So I wrote a big email about this mysterious message I was getting,
but then after some research and poking and debugging tracked it down
to a dangling pointer in C that was causing a callback to point to an
invalid address, which somehow worked anyway 99% of the time.
That all said, I'm not total
prb:
>
> On Jul 4, 2008, at 7:54 AM, Chris Eidhof wrote:
>
> >1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I
> >couldn't get this to work under OS X, while I installed myodbc,
> >which seems to be broken.
>
> FWIW, I've had good luck with the SQLite3 bindings for HDBC o
I'm using hopenssl 1.0 from hackage. What am I doing wrong here?
$ cat test-hopenssl.hs
import OpenSSL.Digest
main=undefined
$ ghc --make test-hopenssl.hs -lcrypto
[1 of 1] Compiling Main ( test-hopenssl.hs, test-hopenssl.o )
Linking test-hopenssl ...
/tmp/ken/lib/hopenssl-1.0/ghc-
On Jul 4, 2008, at 7:54 AM, Chris Eidhof wrote:
1. hdbc. I'd like to connect to MySQL, so I need the ODBC backend. I
couldn't get this to work under OS X, while I installed myodbc,
which seems to be broken.
FWIW, I've had good luck with the SQLite3 bindings for HDBC on MacOS
X. I had a
ramsdell0:
> I'd like to write an obviously correct implementation of a unifier, a
> program that when given two terms, finds a substitution that makes the
> two terms equal. The phrase "obviously correct" is meant to imply
> that the clarity of the code trumps efficiency. As near as I can
> tell
I'd like to write an obviously correct implementation of a unifier, a
program that when given two terms, finds a substitution that makes the
two terms equal. The phrase "obviously correct" is meant to imply
that the clarity of the code trumps efficiency. As near as I can
tell, high performance un
princedpw:
> Hi all,
>
> SML conveniently contains the type "exn" which is an instance of an
> "extensible data type". In other words, unlike normal data types that
> are "closed" (can't admit new constructors once defined), SML's exn
> type is "open," allowing programmers to keep adding new alte
To answer the question in your subject, yes! We have a complex type.
Not only does that make the code simpler and more obvious and idiomatic,
but it's also more efficient because for this use you'd really prefer a
strict pair type for "Point", and complex is strict in it's components.
On Sun, 200
Decided a while ago to write some code to calculate the Mandelbrot set
using the escape iterations algorithm. Discovered after mulling it
about that I could just built it as an infinite list of infinite lists
and then extract any rectangle of values that I wanted:
type Point = (Double, Doub
mfeathers:
> Don Stewart wrote:
> >mfeathers:
> >>
> >>segment :: Int -> [a] -> [[a]]
> >>segment 0 _ = []
> >>segment _ [] = []
> >>segment n x = (take n x) : segment n (drop n x)
> >
> >The first set of parens can go,
> >
> > segment n x = take n x : segment n (drop n x)
> >
> >>I did a version
On Sun, Jul 6, 2008 at 5:25 PM, John Hamilton <[EMAIL PROTECTED]> wrote:
> On Sun, Jul 6, 2008 at 16:45, Michael Feathers <[EMAIL PROTECTED]> wrote:
>>
>>
>> segment :: Int -> [a] -> [[a]]
>> segment 0 _ = []
>> segment _ [] = []
>> segment n x = (take n x) : segment n (drop n x)
>>
>>
>> I did a v
Hi all,
SML conveniently contains the type "exn" which is an instance of an
"extensible data type". In other words, unlike normal data types that
are "closed" (can't admit new constructors once defined), SML's exn
type is "open," allowing programmers to keep adding new alternatives
as often as th
On Sun, Jul 6, 2008 at 16:45, Michael Feathers <[EMAIL PROTECTED]> wrote:
>
>
> segment :: Int -> [a] -> [[a]]
> segment 0 _ = []
> segment _ [] = []
> segment n x = (take n x) : segment n (drop n x)
>
>
> I did a version of this which used splitAt but I wasn't sure whether it was
> going to buy me
mfeathers:
>
>
> segment :: Int -> [a] -> [[a]]
> segment 0 _ = []
> segment _ [] = []
> segment n x = (take n x) : segment n (drop n x)
The first set of parens can go,
segment n x = take n x : segment n (drop n x)
>
> I did a version of this which used splitAt but I wasn't sure whether it
segment :: Int -> [a] -> [[a]]
segment 0 _ = []
segment _ [] = []
segment n x = (take n x) : segment n (drop n x)
I did a version of this which used splitAt but I wasn't sure whether it
was going to buy me anything re performance that would justify its ugliness.
Michael
_
On 2008 Jul 6, at 16:47, Tony Morris wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Michael Feathers wrote:
zip12 ((tails . nub) flightPaths) wayPoints etopsPackets (hd
geoCaches) groundSpeeds headings (map windShift headings)
(regulations !! 2) (foldr (\|/) (tail pathDistances)) [ghy x
Andrew Wagner wrote:
Wow. Where did you come up with the stack trace? That's...impressive.
Pulled it from a blog. I was actually looking for a creepy VB4 or VB5
stack trace I saw years ago that ripped through their dynamic type
resolution layer. Now that would've been funny. :-)
Michael
Don Stewart wrote:
I win, almost ...
13:13:18 dolio: yeah, it was ... almost ... an April 1 style post
:)
And yes, this was truly shocking on a number of levels. However, we have
people doing a lot of weird things with Haskell these days, so its not
as absurd that someone would be hacki
Wow. Where did you come up with the stack trace? That's...impressive.
On Sun, Jul 6, 2008 at 5:07 PM, Don Stewart <[EMAIL PROTECTED]> wrote:
> I win, almost ...
>
>13:13:18 dolio: yeah, it was ... almost ... an April 1 style post
>
> :)
>
> And yes, this was truly shocking on a number of leve
I win, almost ...
13:13:18 dolio: yeah, it was ... almost ... an April 1 style post
:)
And yes, this was truly shocking on a number of levels. However, we have
people doing a lot of weird things with Haskell these days, so its not
as absurd that someone would be hacking up a zip12 for an a
Sorry guys. I was just bored on a Sunday afternoon so I thought I'd
type up a little joke. I thought to myself "Gee, how outrageous can I
make it?"
1) Using and debugging a zip12 function.
2) That fails only on 'take 5' (Brubeck fans take note)
3) Has some absurd arguments like (nub . nub)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Michael Feathers wrote:
>
>
> I have some code that looks like this and I'm having trouble with
> it:
>
>
> zip12 ((tails . nub) flightPaths) wayPoints etopsPackets (hd
> geoCaches) groundSpeeds headings (map windShift headings)
> (regulations !! 2) (f
You're zipping 12 lists here, so how about testing each list
individually? This will narrow down the problem considerably.
Michael Feathers wrote:
>
>
> I have some code that looks like this and I'm having trouble with it:
>
>
> zip12 ((tails . nub) flightPaths) wayPoints etopsPackets (hd geoC
mfeathers:
>
>
> I have some code that looks like this and I'm having trouble with it:
>
>
> zip12 ((tails . nub) flightPaths) wayPoints etopsPackets (hd geoCaches)
> groundSpeeds headings (map windShift headings) (regulations !! 2)
> (foldr (\|/) (tail pathDistances)) [ghy x | x <- [1..],
I have some code that looks like this and I'm having trouble with it:
zip12 ((tails . nub) flightPaths) wayPoints etopsPackets (hd geoCaches)
groundSpeeds headings (map windShift headings) (regulations !! 2)
(foldr (\|/) (tail pathDistances)) [ghy x | x <- [1..], full x]
(nub . nub) arri
29 matches
Mail list logo