*To*: Florian Haftmann <florian.haftmann at informatik.tu-muenchen.de>*Subject*: [isabelle] Code generator: overloaded numeric constants*From*: John Matthews <matthews at galois.com>*Date*: Fri, 11 Jun 2010 16:34:11 -0700*Cc*: isabelle-users <isabelle-users at cl.cam.ac.uk>

Hi Florian,

theory Int_ex imports Main Code_Integer begin definition "foo (x::'a::{number,plus,times}) y = x + 2 * y" export_code foo in Haskell module_name Int_ex file "IntCode"

module Int_ex where { class Plus a where { plus :: a -> a -> a; }; class Times a where { times :: a -> a -> a; }; class Number a where { number_of :: Integer -> a; }; foo :: forall a. (Plus a, Times a, Number a) => a -> a -> a; foo x y =

}

foo x y = plus x (times (number_of 2) y); Should I be including a different adaptation theory here? Thanks, -john

**Attachment:
smime.p7s**

**Follow-Ups**:**Re: [isabelle] Code generator: overloaded numeric constants***From:*Florian Haftmann

- Previous by Date: Re: [isabelle] Code generator "eq" instances
- Next by Date: [isabelle] Haskell code generation feature request
- Previous by Thread: [isabelle] Search, Importing, and Naming in Isabelle
- Next by Thread: Re: [isabelle] Code generator: overloaded numeric constants
- Cl-isabelle-users June 2010 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list