Dear fellow GHC users,
For a number of years GHC has been equipped with the external core language.
For those of you who are unfamiliar with this, it is a way to get GHC to
emit or read in programs in a format which is very close to its internal
intermediate language. This is for instance useful
Trying to recompile GHC (for the template-haskell existential support), but
keeps failing on CABAL (the import for Foreign.Marshal.Alloc is missing
from ghc/lib/compat/Distribution/Version.hs as well as import paths for
Data/Version.hi which is not compiled yet as it depends on ghc-inplace.
There have been quite a few changes here including new directories. Make
sure you cvs update with the -d flag, in both ghc/ and libraries/.
And make sure all makefiles and autoconf stuff is up to date. then
autoreconf and ./configure.
Before doing make, go to ghc/driver and 'make clean'.
Graham Klyne wrote (snipped):
I like the principle of parameterizing Show to allow for different encoding
environments (indeed, I had wondered as I was writing my earlier message if
the two cases were really sufficient). Indeed, in the application area
that interests me (Semantic Web) it
Do you need a language extension at all? You can certainly
do it with the existing extensions!
data ShowDict a
instance Show (ShowDict a) where
showsPrec _ (ShowDict a) = ...
Keean
George Russell wrote:
Graham Klyne wrote (snipped):
I like the principle of parameterizing Show to allow for
Keean Schupke wrote:
Do you need a language extension at all? You can certainly
do it with the existing extensions!
data ShowDict a
instance Show (ShowDict a) where
showsPrec _ (ShowDict a) = ...
I don't understand. How does that help you to, for example, use a function
which
requires Show
George Russell wrote:
I like the idea too, not just for Show but for any instances. It seems to
me that in general you should be able to combine the convenience of the
Haskell type system with the power of Standard ML's structures and functors.
Something along these lines was done by Kahl
Easy:
data ShowHex a
instance Show (ShowHex a) where
showsPrec _ (ShowHex a) = showHex a
main = putStrLn $ (show (ShowHex 27))
Here, with labelled instances you would write:
show ShowHex 27
instead you write:
show (ShowHex 27)
Keean.
George Russell wrote:
Keean Schupke
Of course if you want to do it to code independantly of type you need to
redifine show:
data ShowHex = ShowHex
class ShowDict t a where
showDict :: a - ShowS
instance ShowDict ShowHex Int where
showDict a = showHex a
test :: ShowDict t a = t - a - ShowS
test _ a =
On Mon, Nov 15, 2004 at 12:31:33PM +, Keean Schupke wrote:
Easy:
Here, with labelled instances you would write:
show ShowHex 27
instead you write:
show (ShowHex 27)
What about Ints buried deep in more complicated data structures:
show ShowHex [[1, 2, 3], [4]]
vs.
George Russell wrote:
I like the idea too, not just for Show but for any instances. It
seems to
me that in general you should be able to combine the convenience of the
Haskell type system with the power of Standard ML's structures and
functors.
It looks like it would be easy, but it's very
[Reminder: deadline Dec. 1st is approaching]
**
*** CALL FOR PAPERS ***
******
*** Fifth Workshop on
Hello,
I have some packages for doing signal and image processing stuff.
Here is a little test program :
\begin{code}
module Main where
import Hips
a = listSignal (1,10) [1..10]
b = liftSignals (:+) a a
c = fft b
main = do
putStrLn $ show a
putStrLn $ show b
putStrLn $
(Sorry for the crosspost; I'm not sure which list this should go to.)
I've just completed a pure-Haskell printf. Docs at [1], download at
[2].
Here are some examples:
vsprintf Hello
Hello
vsprintf Hello, %s\n John
Hello, John\n
vsprintf %s, your age is %d\n John (10::Integer)
John, your age
14 matches
Mail list logo