Why does only tr2 work, although the only difference between tr1 and
tr2 is the order of arguments?
import Data.Tree (Tree(..))
data Type a where Tree:: Type a - Type (Tree a)
Int :: Type Int
String :: Type String
type Traversal1 = forall a.a -
Hi,
is there any way to instantiate m in Monad m with a set datatype in
order to implement the usual powerset monad?
My straightforward attempt failed because the bind operator of this
instance requires the Eq constraint on the argument types of m.
Peter
A simplied version of Example 5-16 in Manna's classical book
Mathematical Theory of Computation:
foo x = if x == 0 then 0 else foo (x-1)*foo (x+1)
If run with ghci, foo 5 does not terminate, i.e., Haskell does not look
for all outermost redices in parallel. Why? For efficiency reasons?
It's
I'd like to define a monad Set for types in the class Eq. But how can
the arguments of Set be constrained when Set is defined as an instance
of Monad? instance Eq a = Monad Set where ... obviously cannot work.
Is there a standard update function for fields in data types, something
that OO
At first a type of arithmetic expressions and its generic evaluator:
data Expr = Con Int | Var String | Sum [Expr] | Prod [Expr] | Expr :-
Expr |
Int :* Expr | Expr :^ Int
data ExprAlg a = ExprAlg {con :: Int - a, var :: String - a, sum_ ::
[a] - a,
prod :: [a] - a, sub
Can anybody give me a simple explanation why the second definition of a
palindrome checker does not terminate, although the first one does?
pal :: Eq a = [a] - Bool
pal s = b where (b,r) = eqrev s r []
eqrev :: Eq a = [a] - [a] - [a] - (Bool,[a])
eqrev (x:s1) ~(y:s2) acc = (x==yb,r) where
I'd like to define several instances of the same type class with the
same type variable instance. Only method instances differ. How can I do
this without writing copies of the type class?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Jules Bean wrote:
Try again without missing out the list...
Peter Padawitz wrote:
Jules Bean wrote:
Incidentally, I question why the compFoo are methods. Why not
just make them polymorphic functions? They don't look like you expect
instances to change them. The code continues to compile
Jules Bean wrote:
Peter Padawitz wrote:
Jules Bean wrote:
Peter Padawitz wrote:
What is so bad about making compFoo part of the class? It reduces
the code (constraints can be avoided) and reflects the close
connection between a signature Sig (implemented by the class
--
Prof. Dr. Peter Padawitz
Informatik 1
University of Dortmund
D-44221 Dortmund
Germany
phone +49-231-755-5108
fax +49-231-755-6555
secretary +49-231-755-6223
email [EMAIL PROTECTED]
internethttp://funlog.padawitz.de
Jules Bean wrote:
Peter Padawitz wrote:
Jules Bean wrote:
Peter Padawitz wrote:
Functional dependencies don't work in my case. Actually, I don't
see why they should.
Ah well, it's cruel to say that without explaining to us why!
Cause I don't see why the instantiation conflicts
Jules Bean wrote:
Peter Padawitz wrote:
Functional dependencies don't work in my case. Actually, I don't see
why they should.
Ah well, it's cruel to say that without explaining to us why!
Cause I don't see why the instantiation conflicts pointed out by others
would vanish then.
I'm
are the alternatives? Roughly said, I need a construct that allows me
gather several type variables such that an instance is always an
instance of all of them.
On Dec 3, 2007 7:43 AM, Peter Padawitz [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
What is wrong here? ghci tries
What is wrong here? ghci tries (and fails) to deduce certain types for
the comp functions that I did not expect.
|type Block = [Command]
data Command = Skip | Assign String IntE | Cond BoolE Block Block |
Loop BoolE Block
data IntE= IntE Int | Var String | Sub IntE IntE |
Can scrollbars be attached to windows created with openWindow?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Is f(~p(x))=e(x) semantically equivalent to: f(z)=e(x) where p(x)=z?
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Does anybody know O'Haskell or Timber and its interface Tk.hs to Tcl/Tk
(see here http://fldit-www.cs.uni-dortmund.de/%7Epeter/tk.html)?
I have the following problem:
Tk.hs http://fldit-www.cs.uni-dortmund.de/%7Epeter/Tk.hs contains a
record (structure) /Canvas/ with selectors
line ::
Is there a HGL documentation in one volume (e.g. pdf file)? Printing all
pieces of http://www.haskell.org/ghc/docs/latest/html/libraries/HGL is a
little tedious...
Peter
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Why must every Monad instance be a datatype or newtype, even if there
will be just a single constructor?
Peter
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
How may I hide constructors in O'Haskell 'cause export lists don't work
in this language?
Peter
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Expander2: A Formal Methods Presenter and Animator
==
Expander2 has been designed as a multi-purpose workbench for interactive
logical inference, constraint solving, data flow analysis and other
procedures building up proofs or computation
21 matches
Mail list logo