On Fri, Jun 5, 2009 at 8:05 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Hi John,
John Ky wrote:
full = do
let myOrder = init -- [1]
{ item = Just init
{ itemId = Something
}
, operation = Just
Hi Haskell Cafe,
I'm trying to send stuff over UDP. To do that, I've written a test program
that sends strings across. That was fine, but I wanted to send binary data
too. So I tried that only to find I am having difficulty putting together
some binary data. For examples take the fromHex
Look at Data.Binary (binary package)
It will marshall and unmarshall data types for you. If you don't like
its binary encoding you can dive in there and use the same principles
Cheers
Neil
On 6 Jun 2009, at 07:13, John Ky wrote:
Hi Haskell Cafe,
I'm trying to send stuff over UDP. To do
Hi Haskell Cafe,
In the following code, I get an error saying Ambiguous occurrence `x'. Why
can't Haskell work out which x to call based on the type of getA?
Thanks
-John
#!/usr/bin/env runhaskell
{-# LANGUAGE DisambiguateRecordFields #-}
import A
import B
main = do
let xx = getA
Probably because you don't apply x to xx anywhere?
On 6 Jun 2009, at 11:48, John Ky wrote:
Hi Haskell Cafe,
In the following code, I get an error saying Ambiguous occurrence
`x'. Why can't Haskell work out which x to call based on the type
of getA?
Thanks
-John
#!/usr/bin/env
On Sat, Jun 6, 2009 at 1:48 AM, John Ky newho...@gmail.com wrote:
Hi Haskell Cafe,
In the following code, I get an error saying Ambiguous occurrence `x'. Why
can't Haskell work out which x to call based on the type of getA?
Thanks
-John
#!/usr/bin/env runhaskell
{-# LANGUAGE
Tim Newsham news...@lava.net writes:
Has anyone implemented a primitive like this for Haskell?
This is the CSP external choice operator; it's often called select or
alt in CSP-inspired languages. Neil Brown's CHP library provides CSP
programming facilities in Haskell, including a - choice
Hi Luke,
You're right. My code had a typo. Unfortunately, I still get the same
error whichever way I do it.
For example:
{-# LANGUAGE DisambiguateRecordFields #-}
import A
import B
main = do
let xx = getA
print (x xx)
and:
#!/usr/bin/env runhaskell
{-# LANGUAGE
The error is because of the way records work in Haskell. Recall that a
record is just sugar for the normal datatype syntax. Namely:
data FooA a b c = FooA {getA :: a, getB:: b, getC :: c}
can be accessed as either
f (FooA a b c) = ...
or
f fooA = ... (getA fooA) ... etc
That is,
Hi John,
The record field disambiguation only works if you
use the form
C{ field-name = variable }
where C is a datatype constructor.
In your example you have to write
let TypeA{ x = v } = getA
print v
You're right, after type inference it is clear (for us) that x should
mean A.x, but
Tim Newsham news...@lava.net wrote in article
pine.bsi.4.64.0906051608180.14...@malasada.lava.net in
gmane.comp.lang.haskell.cafe:
Could it be the amb described at
http://conal.net/blog/posts/functional-concurrency-with-unambiguous-choice/
Erik de Castro Lopo mle+hs at mega-nerd.com writes:
src/Data/Binary/Strict/IncrementalGet.hs:106:11:
parse error on input `{-# UNPACK'
Is this a bug? Is there any way to work around it?
This is a haddock error and I presume a bug in haddock. I don't know whether
cabal installs
I tried a cabal install chp: It complained that base was hidden.
So I unpacked the archive, and tried installing using runhaskell
Setup configure/build/install. Now I get (from install):
Setup: You need to re-run the 'configure' command. The version of Cabal being
used has changed (was
Cale Gibbard wrote:
According to the Report:
nubBy:: (a - a - Bool) - [a] - [a]
nubBy eq [] = []
nubBy eq (x:xs) = x : nubBy eq (filter (\y - not (eq x y)) xs)
Hence, we should have that
nubBy () (1:2:[])
= 1 : nubBy () (filter (\y - not (1 y)) (2:[]))
= 1
Hi all,
Please have a look at
http://moonpatio.com/fastcgi/hpaste.fcgi/view?id=2575#a2575
I wanted to use the typesystem to mandate businesslogic (in this case
w3c validation rules).
Thanks to some helpful people in #haskell I learned a bit about phantom types.
Please let me know if I implemented
---
Haskell Weekly News
http://sequence.complete.org/hwn/20090606
Issue 120 - June 06, 2009
---
Welcome to issue 120 of HWN, a newsletter covering
Dear all,
Since its inception my dimensional library has been built around a
unary type-level representation of integers (NumTypes) defined in the
Numeric.NumType module. This module has proven itself useful outside
the context of dimensional and after dragging my feet for a long time
I've
Hi,
I have the following code:
fs g = (g fst, g snd)
examples = (fs fmap, fs liftA, fs liftM, fs id, fs ($(1,2)), fs
((,)id), fs (:[]), fs repeat)
Hello,
I picked an exceedingly case to build an Executable:
Executable QNameTest
Hs-source-dirs: Swish/
Main-Is:HaskellUtils/QNameTest.hs
Other-Modules: HaskellUtils.QName
Here are the results of a cabal build -v:
Creating dist/build/QNameTest (and its parents)
in the following harder case, I see no mention of path Swish/HaskellUtils
. seems not good:
/usr/local/bin/ghc -o dist/build/GraphPartitionTest/GraphPartitionTest
--make -hide-all-packages -i
-idist/build/GraphPartitionTest/GraphPartitionTest-tmp -iSwish/
-idist/build/autogen
Dominic Steinitz wrote:
Erik de Castro Lopo mle+hs at mega-nerd.com writes:
src/Data/Binary/Strict/IncrementalGet.hs:106:11:
parse error on input `{-# UNPACK'
Is this a bug? Is there any way to work around it?
This is a haddock error and I presume a bug in haddock.
On Sat, Jun 6, 2009 at 7:45 PM, Vasili I. Galchin vigalc...@gmail.com wrote:
Hello,
I picked an exceedingly case to build an Executable:
Executable QNameTest
Hs-source-dirs: Swish/
Main-Is: HaskellUtils/QNameTest.hs
Other-Modules: HaskellUtils.QName
Here are
Hi Vasili,
Vasili I. Galchin wrote:
I picked an exceedingly case to build an Executable:
Executable QNameTest
Hs-source-dirs: Swish/
Main-Is:HaskellUtils/QNameTest.hs
Other-Modules: HaskellUtils.QName
I'm not sure what you did; the original Swish code doesn't
On 2009-05-27T03:58:58-0400, Paul L wrote:
One possible solution is to further introduce a fixed point data
constructor, a Rec or even LetRec to explicitly capture cycles. But
then you still incur much overheads interpreting them,
I don't understand this criticism -- what interpretive overhead
Hi, all, a little while ago I uploaded haskeem 0.7.0 to hackage: this
is my small scheme interpreter. I had been busy with other important
stuff for a while, and hadn't worked on it for a while; but I've now
updated it to build ok with ghc 6.10.3 + haskeline, plus I added a
simple macro system;
Hi David,
I commented out Hs-source-dirs
Executable QNameTest
-- Hs-source-dirs: Swish/
Main-Is:HaskellUtils/QNameTest.hs
Other-Modules: HaskellUtils.QName
Here is what I got:
vigalc...@ubuntu:~/FTP/Haskell/Swish-0.2.1$ cabal build -v
Warning: swish.cabal: A
Here is the beginning of QNameTest .. i.e. interface plus imports:
module Swish.HaskellUtils.QNameTest where^M
^M
import System.IO^M
( Handle, IOMode(WriteMode)^M
, openFile, hClose, hPutStr, hPutStrLn^M
)^M
^M
import Data.Maybe^M
( fromJust )^M
^M
import Test.HUnit^M
(
Hi,
I have been trying to build the package network from hackage
(version 2.2.1.3) on Windows Vista, and I could really use some help.
Building on the command line, or under cygwin completely failed
(command line due to cabal not being able to execute
something---possibly configure---although it
To be fair, isn't the printf typing in ocaml a massively ugly hack to
the type system? Isn't there an example in the template haskell
tutorial that gives a typesafe, clean generic printf function?
Max
On Jun 5, 2009, at 4:29 PM, Erik de Castro Lopo wrote:
o...@okmij.org wrote:
Still,
29 matches
Mail list logo