Compiled: Wed Dec 05 00:07:43 PST 2012 from source file: frege/j/Lang.fr
Here live all classes and interfaces from java.lang except those already introduced in the Prelude.
Naming Conventions
These conventions hold for all packages below frege.j.
A java class hierarchy
class C1 { ... } class C2 extends C1 { ... } class C3 extends C2 { ... }
is modeled with frege classes
class IsC1 a where ... class IsC2 IsC1 b => b where ... class IsC3 IsC2 c => c where ...
that define the operations available in the class. The type variable resembles the whole type in case it is a pure type, otherwise the type constructor.
A concrete frege type for java class Foo can then be obtained by:
type Foo = FooT RealWorld // for IO only types type Foo = FooT // for pure types type Foo = FooT Immutable // for ST s types that have pure operations data FooT s = native java.Foo // for mutable tyes data FooT = pure native java.Foo // for immutable ones instance IsFoo FooT // make Foo operations available
In each IsFoo frege class, there shall be a downcast operator
pure native asFoo "(java.Foo)" :: c s -> Foo s
and for each instance method meth that takes non-trivial types as arguments, like in:
public Baz meth(Bar arg)
there be two frege functions: a native one that uses the exact types and a non native one that applies the appropriate asXXX downcasts to the arguments and calls the native one. One can assume, though, that the receiver is of the correct type and does not need conversion.
native methBar meth :: Foo s -> Bar s -> ST s (Baz s) meth foo bar = methBar foo bar.asBar
Overloaded functions can be disambiguated by
Such renaming shall follow the principle of least surprise, and the documentation shall state clearly which java method will be called in the end.
shorthand for runnables in the IO monad
Operations of a java.lang.Runnable
downcast conforming types to java.lang.Runnable
perform the ST action that is associated with this runnable.
inherited from IsRunnable.asRunnable
inherited from IsRunnable.run
A java.lang.Runnable, can be created from IO or ST actions