[Haskell-cafe] Timing in atom -- how consistent?

2009-12-31 Thread Jason Dusek
I'm working with Atom to program an ATtiny25. I am curious about how consistent the timings actually are. Consider John Van Enk' example of blinking a LED on an Arduino: http://code.sw17ch.com/blog/atom/blink_atom.c We see that sometimes `setLED' is executed and sometimes not. Wh

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread Daniel Fischer
Am Donnerstag 31 Dezember 2009 23:41:13 schrieb David Leimbach: >  I recently needed a ring buffer in haskell, so I did it in C http://en.wikipedia.org/wiki/Non_sequitur_(logic) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.or

Re: [Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread Jim Snow
My first thoughts are that you could implement a Ring type using Data.Sequence [1], which is a sort of balanced binary tree where you can insert or remove elements at the beginning or end in amortized O(1) time. You might have a data type like this: data Ring a = Empty | Ring (Seq a) a The

[Haskell-cafe] Announce: data-clist-0.0.3 -- A RingBuffer/CircularList/Ring data type

2009-12-31 Thread John Van Enk
Hi all, data-clist-0.0.3 is up on hackage: http://hackage.haskell.org/package/data-clist-0.0.3 Any feedback is appreciated. The docs are getting there, but not quite complete. Enjoy! /jve ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://w

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread David Leimbach
I recently needed a ring buffer in haskell, so I did it in C and used the FFI :-) This is much nicer. Dave On Thu, Dec 31, 2009 at 2:37 PM, Iavor Diatchki wrote: > Hi, > I usually refer to this structure as a RingBuffer, just an idea. If > you have the time, I would add rough complexity estim

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread Iavor Diatchki
Hi, I usually refer to this structure as a RingBuffer, just an idea. If you have the time, I would add rough complexity estimates to the documentation for the different functions. Thanks for your work! Happy new year, Iavor On Thu, Dec 31, 2009 at 1:13 PM, John Van Enk wrote: > I've decided to

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread John Van Enk
I've decided to settle on Data.CircularList. The renamed git repository is here: http://github.com/sw17ch/data-clist On Thu, Dec 31, 2009 at 3:29 PM, Twan van Laarhoven wrote: > John Van Enk wrote: > >> Hi Heinrich, >> >> >> I think I like Ring more than Necklace or Tom's suggestion of Circular.

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread Twan van Laarhoven
John Van Enk wrote: Hi Heinrich, I think I like Ring more than Necklace or Tom's suggestion of Circular. I chose Ring simply because that's what I was searching for when I wanted the data structure. The package will be named data-ring, so that should hopefully be enough to clue in the user th

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread John Van Enk
Hi Heinrich, Some comments: On Thu, Dec 31, 2009 at 6:27 AM, Heinrich Apfelmus < apfel...@quantentunnel.de> wrote: > Since the name Ring is already taken by an ubiquitous mathematical > structure, and thus already in hackage for example as Algebra.Ring in > the numeric-prelude , I suggest t

Re: [Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread John Van Enk
Hi Daniel, Some follow up on your comments: On Thu, Dec 31, 2009 at 5:54 AM, Daniel Fischer wrote: > Am Donnerstag 31 Dezember 2009 10:59:54 schrieb John Van Enk: > > > Hi List, > > > > > > I recently needed a ring structure (circular list with bi-directional > > > access) and didn't see anythi

Re: [Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread John Van Enk
Hi Luke, Thanks for the feedback. I had some follow up comments. On Thu, Dec 31, 2009 at 5:50 AM, Luke Palmer wrote: > Code looks okay. It suffers from the same persistence/amortization > problem as the classical functional queue; if you happen to shift from > one of the edge cases (eg. prev w

Re: [Haskell-cafe] Lambda's

2009-12-31 Thread Thomas DuBuisson
I agree with Michael in this - such material is out of place for the cafe. On Thu, Dec 31, 2009 at 10:04 AM, Michael Snoyman wrote: > > > On Thu, Dec 31, 2009 at 11:57 AM, Ivan Miljenovic < > ivan.miljeno...@gmail.com> wrote: > >> 2009/12/31 Michael Snoyman : >> > Some of us prefer not to look at

Re: [Haskell-cafe] Lambda's

2009-12-31 Thread Michael Snoyman
On Thu, Dec 31, 2009 at 11:57 AM, Ivan Miljenovic wrote: > 2009/12/31 Michael Snoyman : > > Some of us prefer not to look at that kind of material. I'd appreciate > if, > > in the future, you could either refrain from sending such links or making > it > > clear that they contain objectionable con

[Haskell-cafe] Re: Space Efficiency When Sorting a List of Many Lists

2009-12-31 Thread Heinrich Apfelmus
Felipe Lessa wrote: > Luke Palmer wrote: >> But if you're serious, you can probably do better than just generating >> them all and passing them to sort. I get the impression that there is >> some structure here that can be taken advantage of. > > Isn't what he wants a trie? In particular, a Patr

[Haskell-cafe] Lifting monad syntax sugar

2009-12-31 Thread Maciej Piechotka
I'm not quite sure if it exists but with working with lifted monads/lifted arrows it would be useful. Let f be function from m a to n a where m and n are monad (arrows respectivly) for any a then: > do v <- something 0 >lift (f) g <- somethingElse > h <- somethingInLift >

Re: [Haskell-cafe] Lambda's

2009-12-31 Thread Warren Henning
I like boobs I like functional programming Happy New Years On Wed, Dec 30, 2009 at 3:15 PM, Henk-Jan van Tuyl wrote: > I love lambda's: > http://hawtness.com/2009/12/30/wtf-girl-photo-more-reasons-why-half-life-is-awesome/ ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread Tom Tobin
On Thu, Dec 31, 2009 at 5:27 AM, Heinrich Apfelmus wrote: > Since the name  Ring  is already taken by an ubiquitous mathematical > structure, and thus already in hackage for example as  Algebra.Ring  in > the  numeric-prelude , I suggest to call the data structure  Necklace > instead. Is Necklace

Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists

2009-12-31 Thread Felipe Lessa
On Thu, Dec 31, 2009 at 03:38:51AM -0700, Luke Palmer wrote: > But if you're serious, you can probably do better than just generating > them all and passing them to sort. I get the impression that there is > some structure here that can be taken advantage of. Isn't what he wants a trie? In parti

Re[2]: [Haskell-cafe] Dynamically Linking Foreign Functions

2009-12-31 Thread Bulat Ziganshin
Hello Richard, C/Invoke is another library whose name i forget. > Thanks a lot. Though the haskell wiki [0] claims that libffi works on x64. i don't know, just read yesterday on Lua list: > A question for Fabio: what are the issues with Alien for 64-bit Windows? I can answer part of that. L

Re: [Haskell-cafe] Dynamically Linking Foreign Functions

2009-12-31 Thread Richard Warburton
>> Problem: I don't understand how I can generate the foreign import >> statements at runtime. > > there are special C libraries that doest it. one of them is libffi, > another one (can't recall its name) is used by ghc itself. libffi > isn't x64-compatible, unlike second one Thanks a lot. Though

[Haskell-cafe] Re: Data.Ring -- Pre-announce

2009-12-31 Thread Heinrich Apfelmus
John Van Enk wrote: > Hi List, > > I recently needed a ring structure (circular list with bi-directional > access) and didn't see anything obvious on Hackage. I threw something > together fairly quickly and would like some feedback before tossing it on > Hackage. > > I'd really appreciate if some

Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists

2009-12-31 Thread Daniel Fischer
Am Donnerstag 31 Dezember 2009 11:38:51 schrieb Luke Palmer: > This cartesian product varies in its tail faster than its head, so > every head gets its own unique tail.  If you reverse the order of the > bindings so that it varies in its head faster, then tails are shared. > If my quick and dirty r

Re: [Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread Daniel Fischer
Am Donnerstag 31 Dezember 2009 10:59:54 schrieb John Van Enk: > Hi List, > > I recently needed a ring structure (circular list with bi-directional > access) and didn't see anything obvious on Hackage. I threw something > together fairly quickly and would like some feedback before tossing it on > Ha

Re: [Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread Luke Palmer
On Thu, Dec 31, 2009 at 2:59 AM, John Van Enk wrote: > Hi List, > > I recently needed a ring structure (circular list with bi-directional > access) and didn't see anything obvious on Hackage. I threw something > together fairly quickly and would like some feedback before tossing it on > Hackage. >

Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists

2009-12-31 Thread Luke Palmer
On Wed, Dec 30, 2009 at 9:39 PM, Peter Green wrote: > I can guess that there might be be less laziness and more instantiation when >  sorting is introduced, Yes, by a lot. Sorting requires keeping the entire list in memory. And Haskell lists, unfortunately, are not that cheap in terms of space u

Re: [Haskell-cafe] Dynamically Linking Foreign Functions

2009-12-31 Thread Bulat Ziganshin
Hello Richard, Thursday, December 31, 2009, 12:28:01 PM, you wrote: > Problem: I don't understand how I can generate the foreign import > statements at runtime. there are special C libraries that doest it. one of them is libffi, another one (can't recall its name) is used by ghc itself. libffi i

[Haskell-cafe] Data.Ring -- Pre-announce

2009-12-31 Thread John Van Enk
Hi List, I recently needed a ring structure (circular list with bi-directional access) and didn't see anything obvious on Hackage. I threw something together fairly quickly and would like some feedback before tossing it on Hackage. I'd really appreciate if some one would: 1. make sure the cod

Re: [Haskell-cafe] Lambda's

2009-12-31 Thread Ivan Miljenovic
2009/12/31 Michael Snoyman : > Some of us prefer not to look at that kind of material. I'd appreciate if, > in the future, you could either refrain from sending such links or making it > clear that they contain objectionable content. Agreed; however, looking at the URL does hint that it's NSFW: >

[Haskell-cafe] Dynamically Linking Foreign Functions

2009-12-31 Thread Richard Warburton
Apologies in advance for the length of this email, but I've tried to be as clear as possible. Any help on the matter most appreciated. Goal: I have a simple interpreter for a language that I've written, and I wish to implement an FFI. My ideal api would be like 'ctypes' in python. Here's an exa

[Haskell-cafe] Is cabal option --extra-lib-dirs working?

2009-12-31 Thread Ahn, Ki Yung
I had some problem with --extra-lib-dirs option in cabal-install. I've been trying installing bindings-yices package on hackage. Since yices may be installed in non-standard location, such as under your own home directory, one may have to use --extra-include-dirs and --extra-lib-dirs option. --e

Re: [Haskell-cafe] Lambda's

2009-12-31 Thread Michael Snoyman
Some of us prefer not to look at that kind of material. I'd appreciate if, in the future, you could either refrain from sending such links or making it clear that they contain objectionable content. Thanks, Michael On Thu, Dec 31, 2009 at 1:15 AM, Henk-Jan van Tuyl wrote: > > > I love lambda's:

Re: [Haskell-cafe] Use of the Try typeclass

2009-12-31 Thread Michael Snoyman
I think you need to run "cabal update" On Thu, Dec 31, 2009 at 8:54 AM, Edward Z. Yang wrote: > Excerpts from Michael Snoyman's message of Thu Dec 31 00:43:52 -0500 2009: > > What version of the packages are you using? Can you give the output of: > > > > ghc-pkg list|grep failure > > Sure thing:

Re: [Haskell-cafe] Space Efficiency When Sorting a List of Many Lists

2009-12-31 Thread Patai Gergely
Hi, > explode [[[1,2],[3],[4,5,6]], [[1, 2], [14,15], [16]]] --> [[1,3,4], > [1,3,5],[1,3,6],[2,3,4],[2,3,5],[2,3,6],[1,14,16],[1,15,16], > [2,14,16],[2,15,16]] I don't think the following will solve your problem, but explode can be rewritten with existing functions thanks to the list monad: exp