G'day all.
Thomas Davie wrote:
class IEngine a where
foo :: a -> String
bar :: a -> String -> String
"Apfelmus, Heinrich" <[EMAIL PROTECTED]> replied:
You don't even need a type class, a simple data type is enough.
data Engine = Engine { foo :: IO (), bar :: String -> IO () }
There
On Fri, 2008-12-05 at 18:50 +0100, Thomas Davie wrote:
> On 5 Dec 2008, at 17:46, Duncan Coutts wrote:
>
> > On Fri, 2008-12-05 at 17:06 +0100, Thomas Davie wrote:
> >> On 5 Dec 2008, at 17:00, Duncan Coutts wrote:
> >>
> >>> On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote:
> >>>
> Sure
On 5 Dec 2008, at 17:46, Duncan Coutts wrote:
On Fri, 2008-12-05 at 17:06 +0100, Thomas Davie wrote:
On 5 Dec 2008, at 17:00, Duncan Coutts wrote:
On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote:
Sure, and he could then use a fold instead of a map. Reading files
is
problematic, but
On Fri, 2008-12-05 at 17:06 +0100, Thomas Davie wrote:
> On 5 Dec 2008, at 17:00, Duncan Coutts wrote:
>
> > On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote:
> >
> >> Sure, and he could then use a fold instead of a map. Reading files
> >> is
> >> problematic, but as long as you're only do
On 5 Dec 2008, at 17:00, Duncan Coutts wrote:
On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote:
Sure, and he could then use a fold instead of a map. Reading files
is
problematic, but as long as you're only doing it once (the most
common
situation) is entirely fine wrapped up in an u
On Fri, 2008-12-05 at 16:50 +0100, Thomas Davie wrote:
> Sure, and he could then use a fold instead of a map. Reading files is
> problematic, but as long as you're only doing it once (the most common
> situation) is entirely fine wrapped up in an unsafePerformIO.
No!
Please don't go tel
On 5 Dec 2008, at 16:42, Apfelmus, Heinrich wrote:
Thomas Davie wrote:
You don't even need a type class, a simple data type is enough.
Very true, but I disagree that you've made it functional in any
way, IO
is all about sequencing things, it's very much not a functional style
data Engin
Thomas Davie wrote:
>> You don't even need a type class, a simple data type is enough.
>
> Very true, but I disagree that you've made it functional in any way, IO
> is all about sequencing things, it's very much not a functional style
>>
>> data Engine = Engine { foo :: IO (), bar :: String -> IO
You don't even need a type class, a simple data type is enough.
Very true, but I disagree that you've made it functional in any way,
IO is all about sequencing things, it's very much not a functional style
data Engine = Engine { foo :: IO (), bar :: String -> IO () }
run e = processComman
Thomas Davie wrote:
> Andrew Wagner wrote:
>
>> Hi all,
>> public interface IEngine {
>> void foo();
>> void bar(string bah);
>> ...
>> }
>> public class Program {
>> public void Run(IEngine engine){
>> while(true){
>>string command = GetLine();
>>if (command.startsWith("foo")){
>>
10 matches
Mail list logo