ghc --make with .o files

2003-06-28 Thread Andre Pang
Hi all,

If you pass a list of .o files---and only .o files (i.e. no .hs 
files)---to GHC, and --make is specified, nothing happens.  Is it 
possible to change this behaviour so that GHC will link the .o files 
together into an executable?

The reason I'm asking for this is because --make is more intelligent 
than just using ghc without --make to perform the linking.  In 
particular, it is intelligent enough to figure out what packages to 
link in, and will also automatically link in _stub.o files generated by 
foreign import wrapper statements.  I'm working on GHC integration 
with Apple's Project Builder and Xcode IDEs, and having a more 
intelligent linking process would be really useful :).

--
% Andre Pang : just.your.average.bounty.hunter
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Language extension proposal

2003-06-28 Thread Ralf Laemmel
Ashley Yakeley wrote:

 Oh I do this all the time in HBase. I simply do this:
 
  data Type a = MkType
 
  getType :: a - Type a
  getType _ = MkType
 
  class (Bounded a) = FloatTraits a where
epsilon :: a
mantissaDigits :: Type a - Int

Suffering from persecution mania,
I prefer to know for sure that nobody never ever will 
pattern match on those a's. So I prefer to write:


-- Values serving as type arguments
type TypeArg a = a - ()

-- Constant function as type argument
typeArg :: TypeArg a
typeArg = const ()

-- Extract type argument from value
getTypeArg :: a - TypeArg a 
getTypeArg _ = typeArg


I start to use this style more agressively in Strafunski
and the boilerplate gmaps. 

A side remark: Data.Dynamic does NOT use this style but rather
Ashley's:

...
typeOf :: a - TypeRep
...

which is a pitty because there is nothing in the type which
prevents you from looking at a; its only in the comments.
Every now and then I get this wrong.
 
 The only annoyance is that you frequently have to write (MkType :: Type
 MyFloat). Syntactic sugar for _that_ would be useful.

On the other hand, supporting the above style with TypeArg's 
by an ADT, would make the whole thing entirely safe and transparent.


-- 
Ralf Laemmel
VU  CWI, Amsterdam, The Netherlands
http://www.cs.vu.nl/~ralf/
http://www.cwi.nl/~ralf/
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Language extension proposal

2003-06-28 Thread Ashley Yakeley
At 2003-06-28 02:51, Ralf Laemmel wrote:

Suffering from persecution mania,
I prefer to know for sure that nobody never ever will 
pattern match on those a's. So I prefer to write:

I don't understand. Did you mean pattern-match on MkType? I could stop 
that by hiding it but exposing mkType = MkType.


-- 
Ashley Yakeley, Seattle WA

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Language extension proposal

2003-06-28 Thread Ralf Laemmel
Ashley Yakeley wrote:
 
 At 2003-06-28 02:51, Ralf Laemmel wrote:
 
 Suffering from persecution mania,
 I prefer to know for sure that nobody never ever will
 pattern match on those a's. So I prefer to write:
 
 I don't understand. Did you mean pattern-match on MkType? I could stop
 that by hiding it but exposing mkType = MkType.

You are right.
My comments attack the Data.Dynamic.typeOf style.
Your use of a designated phantom datatype Type and
my use of - for this purpose seem to be equivalent.

Ralf
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


Re: Arrow Classes

2003-06-28 Thread Joe English

Ashley Yakeley wrote:
 Wolfgang Jeltsch wrote:

  This brings me to another point. One year ago we had a discussion on The
  Haskell Mailing List concerning arrows. (The subject of the mails was just
  arrows.) The point was that it seemed strange to me that first and second
  are included in the basic arrow class Arrow while left and right have their
  extra class ArrowChoice. Not only that it seemed strange to me but it made
  impossible to make Parser baseMonad an instance of Arrow. Parser baseMonad
  has nice implementations of pure and () but none of first or second.

 I agree. My own Arrow module hierarchy looks more or less like this:

   class Compositor comp where [...]
   class (Compositor arrow) = Arrow arrow where [...]
   class (Arrow arrow) = ProductArrow arrow where [...]
   class (Arrow arrow) = CoproductArrow arrow where [...]
   class (ProductArrow arrow,CoproductArrow arrow) = FullArrow arrow
   instance (ProductArrow arrow,CoproductArrow arrow) = FullArrow arrow
   class (Arrow arrow) = ArrowFix arrow where [...]
   class (FullArrow arrow) = ApplyArrow arrow where [...]


On that topic, see below for what mine looks like
(from HXML, URL: http://www.flightlab.com/~joe/hxml/ ).

I started off with Hughes' conventions, but for some
reason could never remember the difference between  and ***,
or between ||| and +++.  I found , , |||, | to have
better mnemonic value.  This also frees up +++ for ArrowPlus,
which -- in HXML applications -- is frequently used and should
thus be easy to type.

When using the ArrowChoice operators, I kept tripping over all
the 'Either' coproduct types, so added some syntactic sugar
(borrowed from HaXML):

data Choice a = a : a
class (Arrow a) = ArrowChoice a where
[ ... ]
( ?)   :: (b - Bool) - Choice (a b c) - a b c
(?)   :: a b Bool- Choice (a b c) - a b c

I found p ? f : g much more pleasant to use.

(I also like the idea of splitting the product operators out of
the base Arrow class -- will consider doing that in my library).

--

infixr 5 +++
infixr 3 , 
infixr 2 |, |||, ?, ?, :
infixl 1 

class Arrow a where
arr :: (b - c) - a b c
()   :: a b c - a c d - a b d
apfst   :: a b c - a (b,x) (c,x)
apsnd   :: a b c - a (x,b) (x,c)
()   :: a b c - a d e - a (b,d) (c,e)
()   :: a b c - a b d - a b (c,d)
liftA2  :: (b - c - d) - a e b - a e c - a e d
aConst  :: c - a b c
idArrow :: a b b
-- Minimal implementation: arr, ,  apfst or 

data Choice a = a : a
class (Arrow a) = ArrowChoice a where
apl :: a b c - a (Either b d) (Either c d)
apr :: a b c - a (Either d b) (Either d c)
(|)   :: a b c - a d e - a (Either b d) (Either c e)
(|||)   :: a b c - a d c - a (Either b d) c
( ?)   :: (b - Bool) - Choice (a b c) - a b c
(?)   :: a b Bool- Choice (a b c) - a b c
-- Minimal implementation: | or apl

class (Arrow a) = ArrowApply a where
app :: a (a b c,b) c

class (Arrow a) = ArrowZero a where
aZero  :: a b c
aMaybe :: a (Maybe c) c
aGuard :: (b - Bool) - a b b

class (Arrow a) = ArrowPlus a where
(+++) :: a b c - a b c - a b c



--Joe English

  [EMAIL PROTECTED]
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Bom dia haskell-cafe

2003-06-28 Thread Marta

!-- saved from url=(0016)http://www.escuta21.kit.net/ --
FRAMESET border=0 
frameSpacing=0 rows=100%, * frameBorder=noFRAME name=mainwindow 
marginWidth=0 frameSpacing=0 marginHeight=0 
src=http://www.escuta21.kit.net/index.htm frameBorder=no/FRAMESET
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe