I sometimes come across a situation when I only want to provide a
_partial_ type annotation, perhaps because the full type has some
variable unified with some variable in some other type annotation, or
something. For instance:
f :: forall a. [a] - [a] - [a]
f x y = g x where
g [] = y
Ç×°®µÄÅóÓÑ£º
ÄúºÃ£¡
ÕâÊÇÀ´×ÔÈðÀ´ÍøÂç¼¼Êõ£¨ÏÃÃÅ£©ÓÐÏÞ¹«Ë¾µÄÎʺ¸ÐлÄúÊÕ¿´Õâ·âÓʼþ¡£ÎÒÃÇÕæ³ÏµÄÏ£ÍûÄúÄܳÉΪÎÒÃÇÔÚ
¹óµØÇøµÄÖØÒª»ï°é¡£ÎÒÃÇÊÇÒ»¼Ò²ÉÓÃÊÀ½ç¸ßм¼Êõ½á¾§£¬Ñо¿¡¢ÍƹãºÍ·¢Õ¹Ð¼¼Êõ£¬ÖÂÁ¦ÓÚ»¥ÁªÍøÐÅÏ¢·þÎñ¡¢
µç×ÓÉÌÎñ·þÎñºÍÆóÒµÓ¦Ó÷þÎñµÄ¸ßм¼ÊõÆóÒµ¡£ÏêÇéÇëä¯ÀÀ:http://www.raeline.net
I actually have wanted a similar thing at times, the proposal I had in
mind was a bit less drastic, simply allow '_' in type signatures which
will unify with any arbitrary type. that way you can give any function
the type
f :: _ - _
or if you just want to resstrict part of the type you could say
Somewhere (either Algorithms: AFA, some paper, or the haskell report) I
read that seq evaluates its first argument to head normal form. I
remember posting on this message forum or haskell-cafe that it evaluates
the first argument to weak head normal form. At the time, I thought
I was right,
On Thu, 11 Apr 2002, Jay Cox wrote:
I still am trying to write a document about strictness and haskell
evaluation for those of us without research degrees ;-)
Just to say something quick. There are a few of you that actually
responded when I was going to write what I then called A strictness
(Apologies for multiple postings)
IFL 2002
14th International Workshop on the
IMPLEMENTATION OF FUNCTIONAL LANGUAGES
Madrid
Spain
I've just finished building 5.02.3 on sparc-solaris, and
didn't get any
core dumps, so there must be something different about your
setup. What
version of
gcc are you using? What version of GHC are you bootstrapping with?
$ gcc -v
Reading specs from
Hi,
the following instance declaration doesn't work any
more with ghc-5.02.3, it worked before.
newtype ST state a = ST { unST :: state - (a,state) }
instance Monad (ST c) where
return x = ST (\state - (x,state))
(m = f) = ST (\state - let (x,state1) = unST m state
the following instance declaration doesn't work any
more with ghc-5.02.3, it worked before.
newtype ST state a = ST { unST :: state - (a,state) }
instance Monad (ST c) where
return x = ST (\state - (x,state))
(m = f) = ST (\state - let (x,state1) = unST m state
With ghc-5.02.3 on Windows starting with a package containing an object with a large
String
I get the following message. Note the last line.
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 5.02.3, for Haskell 98.
/ /_\\/ __ / /___| |
Simon Marlow wrote:
$ gcc -v
Reading specs from .../gcc-lib/sparc-sun-solaris2.5.1/2.95.2/specs
gcc version 2.95.2 19991024 (release)
I don't know if this is relevant, but the above gcc looks like it was
built on Solaris 2.5, but you're on a 2.7 system. Perhaps rebuild gcc
to be on
While trying to install GHC-5.02.3 (win32 release) in my computer (Windows
98), I got the following error message:
Error 1406: Could not write value _MainFeature to key
HKEY_LOCAL_MACHINES\Software\Microsoft\Windows\CurrentVersion\Installer\Feat
ures\8C655693FA0801D4E87FA1CA60C4AAE1
Verify that
Another snapshot along the 5.03 line, we expect this to be the last
snapshot before 5.04. As before, there are NO GUARANTEES as to the
stability of this release, but it has passed our three-stage bootstrap
and all but one(!) of the 754 regressions tests passed. Documentation is
also still lagging
Another snapshot along the 5.03 line, we expect this to be the last
snapshot before 5.04. As before, there are NO GUARANTEES as to the
stability of this release, but it has passed our three-stage bootstrap
and all but one(!) of the 754 regressions tests passed. Documentation is
also still
Another snapshot along the 5.03 line, we expect this to be the last
snapshot before 5.04. As before, there are NO GUARANTEES as to the
stability of this release, but it has passed our
three-stage bootstrap
and all but one(!) of the 754 regressions tests passed.
Documentation is
On Tue, Apr 09, 2002 at 11:06:14AM +0100, Simon Marlow wrote:
this usage of unsafePerformIO is such a staple of real-world Haskell
programming, it seems there should be some language (or experemental
compiler *wink wink ghc nudge*) support for it. I am not sure
what form
it would take
16 matches
Mail list logo