of the types I define.
Do you have a code example of what you're trying to do?
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
element. The element at 37 is
the 38th element. It's quite consistent.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
announcements sent to the list ([EMAIL PROTECTED] in particular)?
I'm not really bothered by the way it is...
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
hand with the full Java API hopefully there's less necessity
to use normal IO at all anymore so perhaps it will be less of an issue.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo
SomeLinkedList*);
...you have no choice but to write 'impedance-matching' code for that
function.
structs are not allowed as arguments to foreign imported
functions.
Exactly! And neither are const pointers. But argument const-ness, at
least, can be safely ignored.
--
Ashley Yakeley, Seattle WA
)
A straightforward addition, but not part of my core effort.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
always be mapped to non-const
pointers. Do you have an example of a Haskell type for a foreign import
function, for which the corresponding C function type would be ambiguous?
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
declarations or similar things, btu it doesn't work
out.
Surely one can still do this? This was what we were discussing, was it
not? A C type for any given Haskell function type, not necessarily the
other way around...
--
Ashley Yakeley, Seattle WA
MyModule__StringCopy(char* dest,char* src)
{
strcat(dest,src);
}
(assuming char and signed char are identical).
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow
*. A Haskell function passed a Ptr CChar is not prevented
from modifying the contents of the pointer simply due to its
type-declaration. In C, a char* can be implicitly converted to a const
char* where necessary (but not the other way around).
--
Ashley Yakeley, Seattle WA
At 2001-09-21 09:40, Marcin 'Qrczak' Kowalczyk wrote:
(apologies for the different spelling of finalize - apparently both are
correct and I randomly settled on the 'z' version some time ago).
I guess 's' is British and 'z' is American.
Chambers (of Cambridge, England) has both.
--
Ashley
a `nullPtr'.
Of course...
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
documentation claims that it isn't,
however, but I don't see why.
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
At 2001-09-20 02:31, I wrote:
int foo (char selector,char* arg)
...
if (selector == 200)
I guess that should be
int foo (unsigned char selector,char* arg)
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
can still use the Ptr.
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
();
fooFP' :: ForeignPtr a - IO ();
fooFP' fp = withForeignPtr fp fooP;
--
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
in the C function. Is this
wrong, or not guaranteed?
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
looked like this:
float foo (int *x)
{
return *x;
}
...?
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
- withForeign fp (\p - foo p);
Will foo be passed nullPtr? Will finalFunc ever get called? Is my use,
above, of foreignPtrToPtr safe, and will isNull be True?
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http
, is there another type I can use? In some
cases, the external function may call back into Haskell.
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
At 2001-09-15 02:15, Marcin 'Qrczak' Kowalczyk wrote:
Fri, 14 Sep 2001 23:40:42 -0700, Ashley Yakeley [EMAIL PROTECTED] pisze:
I'm looking for a function that will convert a [Word8] byte-array
to a CString (i.e. a C byte array) for the purposes of FFI.
You can use newArray which allocates
At 2001-09-15 08:31, Mark Carroll wrote:
AFAICS a simple way to get
out of this is to only have one exception type that carries no information
instead of different ones so we can't distinguish one exception from
another, but that's obviously not great.
Isn't that what 'bottom' is?
--
Ashley
cases the caller will not be doing any
kind of extension and so the high three bytes won't need to be masked at
all. Only the caller knows whether extension is necessary, and (as
Sigbjorn points out) whether it needs to do signed or unsigned extension.
--
Ashley Yakeley, Seattle WA
/lib/ghc-5.00/package.conf
Hsc static flags: -static -fignore-interface-pragmas
-fomit-interface-pragmas -fdo-lambda-eta-expansion -flet-no-escape
$ uname -a
Linux server 2.2.19pre17 #1 Tue Mar 13 22:37:59 EST 2001 i686 unknown
--
Ashley Yakeley, Seattle WA
2001 i686 unknown
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
At 2001-07-05 02:23, I wrote:
In this apparent absence I'm writing my own Haskell-JNI bridge.
This now has a home at http://sourceforge.net/projects/jvm-bridge/, and
I'm licensing it under LGPL.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing
in the stub files.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
...
See
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jvm-bridge/source/Haskell/T
ype.hs?rev=HEADcontent-type=text/vnd.viewcvs-markup.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
to
_standard_ platform-independent bit representations...
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
) was
the last thing that successfully loaded, and that it's ready to interpret
stuff.
If you pass the name of a Haskell file to Hugs, it should load the
Prelude and then load the file you gave it.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing
). Phase 2 is to figure out how to create
classes on the fly that can call back to Haskell. Fortunately Java does
provide functions for loading classes from a byte-array of bytecode.
$ ./TestJNI
Hello from Java!
$
I intend to release it open source at some point.
--
Ashley Yakeley, Seattle WA
At 2001-06-27 01:41, Michael Weber wrote:
Would somebody object to a patch which will cause
ghci to quit on :q!?
Oh, and I want C-x C-c
... and C-K Q while we're at it... ;-p
Ya wusses. kill -9 from another shell is the way to go.
--
Ashley Yakeley, Seattle WA
that it can't prove that the two instances don't
conflict for the fundep, even with -fallow-overlapping-instances.
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow
Is there a point to the monomorphism restriction in GHC and Hugs? In
practice, all it seems to mean is occasionally require unnecessary
explicit type signatures.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http
, for instance:
data Zero;
data Succ n;
Unfortunately this is contrary to the Haskell Report. Nevertheless, Hugs
allows it. But GHC, apparently, does not.
--
Ashley Yakeley, Seattle WA
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http
At 2001-05-26 00:47, Rab Lee wrote:
hi, i'm having a bit more touble, can anyone help me
or give me any hints on how to do this :
x 2 3 4 = (x, [2, 3, 4])
Generally we don't solve homework for people. Unless they're studying
under Prof. Karczmarczuk, of course.
--
Ashley Yakeley, Seattle WA
Word16
newtype UCS4CodePoint = MkUCS4CodePoint Word31
type Char = UCS4CodePoint
toUCS4 :: UCS2CodePoint - UCS4CodePoint
fromUCS4 :: UCS4CodePoint - Maybe UCS2CodePoint
encodeUTF16 :: [UCS4CodePoint] - Maybe [UCS2CodePoint]
decodeUTF16 :: [UCS2CodePoint] - Maybe [UCS4CodePoint]
--
--
Ashley
.
Monads happen to be a useful pattern for such things.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
of Moggi. They are natural thus to construct
parsers. Imperative programming is just one facet of the true story.
Perhaps, but mostly monads are used to model imperative actions. And
their use in imperative programming is the obvious starting point to
learning about them.
--
Ashley Yakeley, Seattle
libraries written for that. I'm less interested in
Haskell 98, since it means muckier solutions to the same problems.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
Char is not an instance of Foo. See the Anomalous Class
Fundep Inference thread.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
At 2001-05-02 04:54, Keith Wansbrough wrote:
Ah, but (i) not all the solutions are correct (sorry Ashley);
That rather depends on what you mean by CAPITALISE, does it not?
capitalise, -ize to print or write with capital letters [Chambers]
--
Ashley Yakeley, Seattle WA
of a Midsummer morn)!
England shall bide till Judgement Tide,
By Oak, and Ash, and Thorn!
(from _Puck of Pook's Hill_, Rudyard Kipling).
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
.
--
Ashley Yakeley, Seattle WA
MarkerType.hs
At 2001-04-19 01:19, Ashley Yakeley wrote:
Herewith my attempt.
Sorry, that should have gone to the Haskell Cafe list.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
e
when proportional accuracy is needed over a wide range of scales.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
you can with C++ templates, you can't do strongly-typed
dimensions in Haskell...
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
) (times (toUnit 3.7) inch)
someLengthInches = fromUnit (divby someLength inch)
--
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
AnyCharable = forall c. (Charable c) = MkAnyCharable c
anyA = MkAnyCharable 'a'
recoverA = obtainChar ((\(MkAnyCharable c) - c) anyA)
--
Whoops, my error. It is possible to do this:
--
recoverA = (\(MkAnyCharable c) - obtainChar c) anyA
--
Sorry...
--
Ashley Yakeley, Seattle WA
be owned by Sun.
Will it be standard practice for versions of Standard be included with
Haskell compilers?
Could the Prelude make use of Standard?
Could Standard become an alternative to the Prelude?
If answers to these last three are all "no", an alternative would be to
- Int
comp n = unliftM (do x - ... return x)
The correct way to express this is:
comp :: Int - IO Int
comp n = (do x - ... return x)
I think of "IO Int" meaning "instructions for an imperative action, that,
if performed, would return an Int". That's quite different from an Int
foo :: a - c a
type T m = IO m
instance MyClass T where
foo = return
--
Hugs gives:
(line 6): Not enough arguments for type synonym "T"
So is T a real type constructor or not?
--
Ashley Yakeley, Seattle WA
___
Haskell mailing l
annoying. Is this really necessary? It would
be nice if T were, as you say, a first-class type-constructor.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
, or suggestions.
Apologies if this has been discussed and I missed it. When it comes to
writing a 'geek' prelude, what was wrong with the Basic Algebra Proposal
found in ftp://ftp.botik.ru/pub/local/Mechveliani/basAlgPropos/ ?
Perhaps it could benefit from multi-parameter classes?
--
Ashley Yakeley
(a.mValue * b.mValue);
}
// etc.
int main()
{
Unit0,1,0 oneMetre(1);
Unit0,1,0 twoMetres = oneMetre + oneMetre;
Unit0,2,0 oneSquareMetre = oneMetre * oneMetre;
}
--
Can you do this sort of thing in Haskell?
--
Ashley Yakeley, Seattle WA
of lists, and then once you've done that you can
apply it to make the special case of three items like this:
cartesianProduct a b c = product [a,b,c]
At least, that's how I would do it.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL
At 2001-02-08 02:04, Ashley Yakeley wrote:
That's easy. Just define 'product' as a function that finds the cartesian
product of any number of lists, and then once you've done that you can
apply it to make the special case of three items like this:
cartesianProduct a b c = product [a,b,c
.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
At 2001-01-30 19:52, Fergus Henderson wrote:
On 30-Jan-2001, Ashley Yakeley [EMAIL PROTECTED] wrote:
At 2001-01-30 02:37, Fergus Henderson wrote:
class BaseClass s where
downcast_to_derived :: s - Maybe Derived
Exactly what I was trying to avoid, since now every base class needs
= Any 'p'
--
...are you saying that a1 and a2 do not have to carry types at runtime?
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
downcast :: Base - Maybe Derived
--
How do I define downcast?
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
At 2001-01-21 10:57, David Bakin wrote:
What's a 'quant' ...
and is it good or bad to be one?
I think that depends on exactly how much of a quant you are.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http
is not always an Integer. It's of type "(Num a) = a".
I couldn't find a way to say that every Num is a C.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
it is one) but 3.1
cannot be.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
At 2001-01-17 16:07, Johan Nordlander wrote:
Ashley Yakeley wrote:
OK, I've figured it out. In this O'Haskell statement,
struct Derived Base =
value :: Int
...Derived is not, in fact, a subtype of Base. Derived and Base are
disjoint types, but an implicit map of type "De
At 2001-01-16 00:03, Johan Nordlander wrote:
Ashley Yakeley wrote:
How do you do OOP-style polymorphic functions in O'Haskell? My first
attempt looked something like this:
struct Base
struct Derived Base =
value :: Int
theValue :: Base - Maybe Int
theValue x = Just (x.value
this imply that run-time type information is kept with the
structs?
Consider:
d :: Derived
d = struct
value = 3
b :: Base
b = d
idb :: Base - Base
idb x = x
f1 = theValue d
f2 = theValue b
f3 = theValue (idb d)
f4 = theValue (idb b)
What are the values of f1, f2, f3 f4?
--
Ashley Yakeley, Seattle
At 2001-01-16 13:18, Magnus Carlsson wrote:
f1 = Just 3
f2 = f3 = f4 = Nothing
So I've declared b = d, but 'theValue b' and 'theValue d' are different
because theValue is looking at the static type of its argument?
What's to stop 'instance TheValue Base' applying in 'theValue d'?
--
Ashley
At 2001-01-16 02:48, Jan Kort wrote:
Ashley Yakeley wrote:
Would some kind Haskell-to-Java bridge be a cost-effective way of
providing a multi-platform GUI library, as well as network, SQL, RMI
etc., etc.?
It doesn't necessarily imply compiling to the JVM. Java could simply see
struct M D1,D2
m = struct
a1 = 0
a2 = 0
f = theValue m
What's the value of f?
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
a) = TheValue (Maybe a) where theValue _ = 2
trouble = theValue (Just 'b')
I got a syntax error:
(line 3): syntax error in instance head (variable expected)
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http
to be of type Base, so x.value gives
an error. I tried replacing it with
theValue (x :: Derived) = Just (x.value)
...but that doesn't work either.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman
a multi-platform GUI library, as well as network, SQL, RMI
etc., etc.?
It doesn't necessarily imply compiling to the JVM. Java could simply see
the compiled Haskell code through the JNI.
--
Ashley Yakeley, Seattle WA
___
Haskell-Cafe mailing list
Are there any plans to port GHC to Darwin? Darwin is a FreeBSD-variant
that runs on the PowerPC processor.
http://www.opensource.apple.com/projects/darwin/.
I was going to compile it myself before I remembered that compilers do
platform-specific code-generation. Duh.
--
Ashley Yakeley
n - 1) * 19) 26) + 1
engql c = renum (letter c)
engq = (foldl (+) 0) . (map engql)
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
to modify the concept of
'principal type'?
Do any papers exist about this topic? Is there any
Haskell compiler supporting union types?
You might look at O'Haskell, which I understand has some kind of
OOP-style polymorphism. I don't know if it has union types though.
--
Ashley Yakeley,
. Informally, you want the
type most general in the type-substitution sense, but probably most
specific in the subtype sense.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
in Haskell's existing monadic imperative model,
something that shouldn't need any runtime extensions.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
handle)
stealHandle = read
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
()
withFile (withFile copyFile "dest") "source"
...but I'm not sure how to write copyFile.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
destruction, so that this kind of error is always caught at compile-time.
--
Ashley Yakeley, Seattle WA
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
te :: (Integer,[Byte]) - HandleOperation ()
withFile :: HandleOperation a - String - IO a
Of course, I'd then need to provide functions to compose/concatenate
HandleOperation values. But I can't help thinking this problem is already
well-known and there's a straightforward solution...
--
Ashley
601 - 682 of 682 matches
Mail list logo