Brian Denheyer bri...@aracnet.com writes:
doEvent f usDelay = forkIO $
threadDelay usDelay
doEvent f usDelay
f
There's a missing 'do' here, right?
Infinite loop? yes, that is what you wanted. Memory gobbling? Why
would you think that?
Why would I think that ?
doEvent f
Daniel Fischer daniel.is.fisc...@web.de writes:
It has been known to call such things 'computations',
I think actions has been used, too, but perhaps mostly for things in
IO and similar monads?
as opposed to 'values', and even to separate the categories of types
and expressions which
Brian Denheyer bri...@aracnet.com writes:
doEvent f usDelay = forkIO $
threadDelay usDelay
doEvent f usDelay
f
There's a missing 'do' here, right?
Yes - I said that in a later e-mail but it doesn't fix me violating my own
peeve about non-functional code snippits on -cafe.
Johan,
Thanks for the (mostly) positive news about ThreadScope on Mac OS-X: that's
great news. I plan to add a few more Save As... image options in ThreadScope
0.2 plus the ability to turn transparency on/off for PNG files. So hopefully
one of the Save As formats might work. I don't think it
Dear cafe,
Could anyone provide a link to some paper/book (electronic version of
both preferred, even if not free) that describes an algorithm of
translation of untyped lambda calculus expression to a set of
combinators? Preferably SKI or BCKW. I'm either feeding google with
wrong question
See, for example, slide 119 and onwards in the slides at
http://www.cl.cam.ac.uk/teaching/0809/FFuncProg/FoFP_2009_slides.pdf
The slides covers SKI and BCSKI.
Cheers,
Max
2010/1/28 Dušan Kolář ko...@fit.vutbr.cz:
Dear cafe,
Could anyone provide a link to some paper/book (electronic version
Also see http://www.haskell.org/haskellwiki/Super_combinator Wiki page.
Fixed set of combinators gives you complexity of translation that is
more than linear of the length of lambda expression.
The length of output string is O(3^length(lambdaExpression)) for SK
combinator pair.
2010/1/28 Dušan
Thomas DuBuisson thomas.dubuis...@gmail.com writes:
Yes - I said that in a later e-mail but it doesn't fix me violating my own
peeve about non-functional code snippits on -cafe.
I guess we're spoiled by the type checker catching all our mistakes.
Since I recently discovered the new and
Hi Dušan
The Ester shell written in Clean compiles via the SKI combinators. It
is describe in the paper - 'A Functional Shell that Operates on Typed
and Compiled Applications' by Arjen van Weelden and Rinus Plasmeijer
which is available here:
Will Ness wrote:
Heinrich Apfelmus writes:
(Just for historical reference, credit for the data structure that works
with infinite merges goes to Dave Bayer, I merely contributed the
mnemonic aid of interpreting it in terms of VIPs.)
yes, yes, my bad. GMANE is very unreliable at presenting
Hi,
is there a library which converts from utf-16 to utf-8?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
iconv?
Günther Schmidt wrote:
Hi,
is there a library which converts from utf-16 to utf-8?
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Günther Schmidt gue.schm...@web.de writes:
is there a library which converts from utf-16 to utf-8?
The text library can (you can also choose between big and little endian
UTF-16).
Günther
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On 28 Jan 2010, at 03:09, Twan van Laarhoven wrote:
For example, in Map String Integer (sparse representation of
monomials) compute the minimum value of all associative pairs with
the same key (the gcd); if only one key is present, the absent
should be treated as having value 0. So
Hi Ivan,
thanks for the tip, but how do I use the library?
I can't really make out how to feed it UTF-16 and get String (UTF-8) back.
Günther
BTW: I need this function because I'm using HDBC-ODBC with MS Access and
in MS Access apparently every string is in UTF-16.
Am 28.01.10 12:47,
Hello Gunther,
Thursday, January 28, 2010, 4:07:07 PM, you wrote:
thanks for the tip, but how do I use the library?
I can't really make out how to feed it UTF-16 and get String (UTF-8) back.
Haskell String type isn't UTF-8 encoded. it's [Char] where Char is in
UCS-4 aka UTF-32 :)
BTW: I
Günther Schmidt gue.schm...@web.de writes:
thanks for the tip, but how do I use the library?
I can't really make out how to feed it UTF-16 and get String (UTF-8)
back.
One way (probably not very efficient):
import Data.Text.Encoding
convert :: Bytestring - Bytestring
convert = encodeUtf8 .
2010/1/28 Bulat Ziganshin bulat.zigans...@gmail.com
Hello Gunther,
Thursday, January 28, 2010, 4:07:07 PM, you wrote:
thanks for the tip, but how do I use the library?
I can't really make out how to feed it UTF-16 and get String (UTF-8)
back.
Haskell String type isn't UTF-8 encoded.
Hello Johan,
Thursday, January 28, 2010, 4:20:48 PM, you wrote:
Haskell String type isn't UTF-8 encoded. it's [Char] where Char is in
UCS-4 aka UTF-32 :)
That's not quite correct. [Char] is a sequence of Unicode code
points, UTF-32 is one possible encoding of those code points. The
There is a nice simple algorithm on wikipedia:
http://en.wikipedia.org/wiki/Combinatory_logic
(for both SKI and BCKW)
translated to haskell:
-- The anoying thing about the algorithm is that it is difficult to separate
the SKI and LC expression types
-- it's easiest to just combine them.
data
On Wed, 27 Jan 2010 23:10:29 -0800
Don Stewart d...@galois.com wrote:
briand:
Hi all,
ghc-core.hs:263:13:
Not in scope: data constructor `C.ExitException'
Looks like this comes from the base control.exception ?
When I go to the web page for control.exception, there is no
Am Donnerstag 28 Januar 2010 09:14:38 schrieb Ketil Malde:
Daniel Fischer daniel.is.fisc...@web.de writes:
It has been known to call such things 'computations',
I think actions has been used, too, but perhaps mostly for things in
IO and similar monads?
as opposed to 'values', and even to
Brian Denheyer wrote:
On Tue, 26 Jan 2010 22:41:44 -0800
Thomas DuBuisson thomas.dubuis...@gmail.com wrote:
doEvent f usDelay = forkIO $
threadDelay usDelay
doEvent f usDelay
f
Are you sure that's right ? It seems to be a memory-gobbling
infinite loop...
Why
On Thu, Jan 28, 2010 at 09:23:23AM -0500, Job Vranish wrote:
-- The anoying thing about the algorithm is that it is difficult to separate
the SKI and LC expression types
-- it's easiest to just combine them.
Why is it difficult?
--
Felipe.
___
Why is it difficult?
Ideally we'd like the type of convert to be something like:
convert :: LambdaExpr - SKIExpr
but this breaks in several places, such as the nested converts in the RHS of
the rule:
convert (Lambda x (Lambda y e)) | occursFree x e = convert (Lambda x
(convert (Lambda y e)))
Quoth Daniel Fischer daniel.is.fisc...@web.de,
Am Donnerstag 28 Januar 2010 09:14:38 schrieb Ketil Malde:
Daniel Fischer daniel.is.fisc...@web.de writes:
As usual, that only works part of the time. [1,4,15,3,7] is not a
computation, it's a list of numbers. A plain and simple everyday
value.
To install on ghc-6.12.1 I had to modify the .cabal to accept containers
package version 0.3 (I already had the gtk2hs installed). It works fine at
first glance, will use it more.
- containers = 0.2 0.3
+containers = 0.2 0.4
Cheers,
Thomas
On Wed, Jan
Hi,
I need to use MS Access as a DB-backend. To make it not too easy there
are tables with Umlaut Strings in some of the columns.
Using HDBC-ODBC the Umlauts get merely garbled, I believe because
MS-Access delivers in some sort of UTF-16 and HDBC-ODBC seems to manage
that fine safe for the
I'm looking for some algorithmic suggestions:
I have a set of several hundred key/value pairs. The keys are 32-bit
integers, and are all distinct. The values are also integers, but the
number of values is small (only six in my current problem). So,
obviously, several keys map to the same value.
On Sat, Jan 23, 2010 at 01:02:07AM -0200, Maurício CA wrote:
bindings-DSL is a mature and well documented preprocessor domain
specific language you can use to generate bindings to a C API.
It's based on functionality provided by hsc2hs. These are links to
Hackage page and documentation:
On Thu, 2010-01-28 at 14:07 -0500, Steve Schafer wrote:
I'm looking for some algorithmic suggestions:
I have a set of several hundred key/value pairs. The keys are 32-bit
integers, and are all distinct. The values are also integers, but the
number of values is small (only six in my current
On 28 Jan 2010, at 20:07, Steve Schafer wrote:
The data are currently in a large lookup table. To save space, I'd
like
to convert that into a sort of hash function:
hash :: key - value
My question is this: Is there any kind of generic approach that can
make
use of the knowledge about the
OK, this is going to be a long one...
Let's start with parsers. A monadic parser library (e.g., Parsec) gives
you a set of primitive parsers. It also supplies functions to construct
more complex commonly-used parsers. And then it provides functions for
constructing even more complex parsers.
On Thu, Jan 28, 2010 at 12:42 PM, Andrew Coppin
andrewcop...@btinternet.com wrote:
I wonder if you can make a parser combinator library which is *not* monadic?
And, if you could, in what way would that limit the kinds of things you can
parse?
Absolutely! I believe both Applicatives and Arrows
On Jan 28, 2010, at 9:31 PM, Luke Palmer wrote:
I don't remember the name, but there is a technique where you compose
the features you want and then take its fixed point to get your AST.
Did you think of Data types à la carte by Wouter Swierstra?
http://hackage.haskell.org/package/bindings-DSL
http://bitbucket.org/mauricio/bindings-dsl
The only thing I've missed for now is a #ccall equivalence
for stdcall functions, I hacked one up myself and called it
#stdcall, but it would be nice to have in the package proper if
possible.
On Thu, Jan 28, 2010 at 09:36:42PM -0200, Maurício CA wrote:
The only thing I've missed for now is a #ccall equivalence
for stdcall functions, I hacked one up myself and called it
#stdcall, but it would be nice to have in the package proper if
possible.
Here is my attempt. I added
On 2010-01-28 20:31, Luke Palmer wrote:
I could be mistaken, but at least there are both Applicative and Arrow
parser libraries. I don't know how to classify the language that they
parse -- it is not strictly context-free. It corresponds roughly to
context-free where certain types of infinite
Luke pretty much nailed the summary of what you can parse using Applicative
means. I tend to consider them codata CFGs, because they can have infinite
breadth and depth. However, a 'codata CFG' can handle a much larger class of
languages than CFGs. To that end, it is interesting to consider that
On Thu, Jan 28, 2010 at 7:58 PM, Nils Anders Danielsson n...@cs.nott.ac.uk
wrote:
If the token set is finite you don't get any expressive advantage from a
monadic parser combinator library (in a lazy setting): you can parse any
decidable language using a simple library with an applicative
Here is my attempt. I added #callconv macro, that accepts
a calling convention parameter. The lines below are now
equivalent.
Builds fine here and looks reasonably fine.
Okay. Package uploaded, documentation updated.
Best,
Maurício
___
But your example uses a recursive type; the interesting bit about this
example is that there is no recursive types or function, and yet we
can encode this loop.
-- ryan
On Wed, Jan 27, 2010 at 4:49 PM, Matthew Brecknell
matt...@brecknell.net wrote:
Ryan Ingram wrote:
The compiler doesn't
import Text.Regex
date_by_ntday dateStr ntday = do
let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
Which package(s) do i need to use Text.Regex ?
Sincerely!
-
fac n = foldr
On 29/01/2010 03:51, zaxis wrote:
import Text.Regex
date_by_ntday dateStr ntday = do
let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
Which package(s) do i need to use
z_axis:
import Text.Regex
date_by_ntday dateStr ntday = do
let [y,m,d] = map (\x - read x::Int) $ splitRegex (mkRegex -) dateStr
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
Which package(s) do i need to use Text.Regex ?
In general,
Here is a bit more simplified version of the example. The example has
no value level recursion and no overt recursive types, and no impredicative
polymorphism. The key is the observation, made earlier, that two types
c (c ()) and R (c ())
unify when c = R. Although the GADTs R c below is
46 matches
Mail list logo