I am using Windows version with Visual Studio Shell integration. I had encountered the same problem.

However, the IDE suggested me to add FSharp.PowerPack.dll and the problem was gone.

It works in the compiled version but not the interactive console. I don't know the corresponding name space to use.

I am not sure if this also applies in your Mac OSX environment

By on 9/17/2008 2:59 AM ()

I had the problem.

Open up the F# Interactive.

And, type the line starting with

#r @"FSharp.PowerPack";;

Then, it work.

By on 9/18/2008 11:44 AM ()

Thanks a lot, David. It works.

Is it possible to load the DLL by default so that we don't need to type this command everytime we open up the F# Interactive ?

By on 9/23/2008 4:46 AM ()

Yes, but it's not perfect yet. If you have lots of configuration you can put all your configuration for fsi in common script and load it using the switch "--load" or the command #load.

Cheers,

Rob

By on 9/23/2008 5:17 AM ()

Noted with thanks, Robert.

By on 9/26/2008 5:20 AM ()

=================================

FSI for Mono .Net 1.x

(note: i didnt use --no-readline,

but didnt experience "display" problems either)

I only had to type Shift-S once; for String.map;;

I typed StrString.map;;

=================================

should have read

=================================

FSI for Mono .Net 1.x

(note: i didnt use --no-readline,

but didnt experience "display" problems either)

I only had to type Shift-S once; for String.map;;

I typed Str<backspace><backspace><backspace>String.map;;

=================================

By on 1/27/2008 6:57 PM ()

Maybe I'm not tracking this discussion accurately, but isn't the problem simply that "split" starts with a lower-case 's', and you typed it with an upper-case 's'? "split()" is a static function of F#'s String module.

1
2
3
> String.split [' '] "Tony Albert Nassar";;
val it : string list = ["Tony"; "Albert"; "Nassar"]
>
By on 2/3/2008 5:21 AM ()

(2) should have read:

(2) If I made a mistake and I hit delete or backspace, my display does not update correctly (e.g., I typed
Str<backspace><backspace><backspace>ing.map;;
my screen shows String.map;;

fsi gets ing.map and I get an error message;;
OR i type Str<backspace><backspace><backspace>String.map;;
my screen shows StrString.map;;

i get some syntax error messages but then at some point fsi seems to get the "correct" input (see trace reproduced below)

By on 1/27/2008 6:50 PM ()

thanks! doesn't seem to have an effect.

Tthree things I noticed:
(1) with fsi for Net 2.0, I need to type Shift-s twice to get String.split;; to run without getting any error messages (even though the display might be screwed up e.g., it'll show String.split;; or tring.split;; even though I typed SString.split;; and fsi will get the "correct" input)
(2) If I made a mistake and I hit delete or backspace, my display does not update correctly (e.g., I typed Str<backspace><backspace><backspace>ing.map;; my screen shows String.map;; fsi gets ing.map and I get an error message;; OR i type Str<backspace><backspace><backspace>String.map;; my screen shows StrString.map;; i get some syntax error messages but then at some point fsi seems to get the "correct" input (see trace reproduced below)
(3) I dont get these problems when i switch back to fsi for .Net 1.x.

====================

FSI for Mono .Net 2.x

====================

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
mono fsi.exe --no-readline --no-gui
MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.3.14, compiling for .NET Framework Version v2.0.50727
NOTE: 
NOTE: See 'fsi --help' for flags
NOTE: 
NOTE: Commands: #r <string>;;    reference (dynamically load) the given DLL. 
NOTE:           #I <string>;;    add the given search path for referenced DLLs. 
NOTE:           #use <string>;;  accept input from the given file. 
NOTE:           #load <string> ...<string>;;
NOTE:                            load the given file(s) as a compilation unit.
NOTE:           #time;;          toggle timing on/off. 
NOTE:           #types;;         toggle display of types on/off. 
NOTE:           #quit;;          exit. 
NOTE: 
NOTE: Visit the F# website at http://research.microsoft.com/fsharp.
NOTE: Bug reports to fsbugs@microsoft.com. Enjoy!
> tring.split;;
val it : (char list -> string -> string list) = <fun:clo@0>
> StrString.map;;
  StrString.map;;
  ---^^
stdin(2,3): error: syntax error.
> 
  StrString.map;;
  ----^^
stdin(2,4): error: syntax error.
> 
  StrString.map;;
  -----^^
stdin(2,5): error: syntax error.
> val it : ((char -> char) -> string -> string) = <fun:clo@0_1>
> #quit;;
- Exit...

=================================

FSI for Mono .Net 1.x
(note: i didnt use --no-readline,
but didnt experience "display" problems either)
I only had to type Shift-S once; for String.map;;
I typed Str<backspace><backspace><backspace>String.map;;

=================================

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
mono fsi.exe --no-gui
MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.3.14, compiling for .NET Framework Version v1.1.4322
NOTE: 
NOTE: See 'fsi --help' for flags
NOTE: 
NOTE: Commands: #r <string>;;    reference (dynamically load) the given DLL. 
NOTE:           #I <string>;;    add the given search path for referenced DLLs. 
NOTE:           #use <string>;;  accept input from the given file. 
NOTE:           #load <string> ...<string>;;
NOTE:                            load the given file(s) as a compilation unit.
NOTE:           #time;;          toggle timing on/off. 
NOTE:           #types;;         toggle display of types on/off. 
NOTE:           #quit;;          exit. 
NOTE: 
NOTE: Visit the F# website at http://research.microsoft.com/fsharp.
NOTE: Bug reports to fsbugs@microsoft.com. Enjoy!
> String.split;;
  String.split;;
  -------^^^^^^
stdin(1,7): error: FS0039: The value, constructor, namespace or type 'split' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> String.map;;
val it : ((char -> char) -> string -> string) = <fun:clo@0>
> #quit;;
- Exit...
By on 1/27/2008 6:46 PM ()

not sure if this prints out better, but here goes:

========================

Note particularly the following:

1
2
3
4
5
6
7
> .split;;
  tring.split;;
  ^^^^^^
stdin(1,0): error: FS0039: The namespace or module 'tring' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> Striing.map;;

==================================

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ mono bin/fsi.exe --no-gui
MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.3.14, compiling for .NET Framework Version v2.0.50727
NOTE: 
NOTE: See 'fsi --help' for flags
NOTE: 
NOTE: Commands: #r <string>;;    reference (dynamically load) the given DLL. 
NOTE:           #I <string>;;    add the given search path for referenced DLLs. 
NOTE:           #use <string>;;  accept input from the given file. 
NOTE:           #load <string> ...<string>;;
NOTE:                            load the given file(s) as a compilation unit.
NOTE:           #time;;          toggle timing on/off. 
NOTE:           #types;;         toggle display of types on/off. 
NOTE:           #quit;;          exit. 
NOTE: 
NOTE: Visit the F# website at http://research.microsoft.com/fsharp.
NOTE: Bug reports to fsbugs@microsoft.com. Enjoy!
> .split;;
  tring.split;;
  ^^^^^^
stdin(1,0): error: FS0039: The namespace or module 'tring' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> Striing.map;;
  Striing.map;;
  ^^^^^^^^
stdin(2,0): error: FS0039: The namespace or module 'Striing' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> String.map;;
val it : ((char -> char) -> string -> string) = <fun:clo@0>
> #quit;;
- Exit...
By on 1/27/2008 4:43 PM ()

Try "fsi --no-readline". If anything GUI-related fails try "fsi --no-readline --no-gui"

Notice you spelt "Striing" wrong above in "String.map"

Thanks!

don

By on 1/27/2008 5:03 PM ()

As others have reported, using fsi-old.exe fixed my larger issues as well. However, the --no-readline option definitely messes up my terminal -- console echo is missing on startup and somehow color highlighting goes crazy on me. If I explicitly use the --readline option, everything is much happier -- except I have noticed that the backspace key is no longer mapped properly and I need to use ctrl-h instead. Does anyone have an idea what is clobbering the terminal settings?

My setup:

OS X 10.5.1 Terminal.app

Mono JIT compiler version 1.2.6 (tarball)

F# Version 1.9.3.14, compiling for .NET Framework Version v2.0.50727

By on 2/12/2008 11:53 PM ()

The current F# dsitribution still by default uses Mono's ".NET 1.0" configuration by default. Unfortunately String.split is only supported when using the .NET 2.0 configuration. I apologise that the first sample of the book uses something that is not seamlessly supported on Mono: it was a silly oversight.

I'm sure someone on the forums will contribute a String.split implementation you can put just before your code, and we've added String.split to the latest F# release.

We are also looking at using the .NET 2.0 configuration by default on Mono. You can do this yourself by removing your current installation of F#, unpacking it again, and deleting or commenting out the following lines from install-mono.sh before you install:

1
2
3
echo "Replacing fsi.exe and fsc.exe with programs that run under .NET 1.0..."
cp -p bin/fsi.exe bin/fsi-old.exe
cp -p bin/fsi10.exe bin/fsi.exe

You can also avoid reinstalling by copying back the fsi-old.exe, as long as you haven't run install-mono.sh twice already...

Please let us know if that works.

Kind regards

don

By on 1/27/2008 11:35 AM ()

Hi Don,
Thanks for the suggestions (which seemed to work for the most part but note the "display/delayed echo/buffer(?)" problems reported below. not sure if other Mono/Mac OS X users have encountered similar problems or if problems are specific only to mono/mac os x users but ...).

I did both:
(1) delete current install, unpack again, comment out the two lines you suggested, and run the new install-mono.sh;
(2) delete current install, unpack again, run install-mono.sh, cp fsi-old.exe to fsi.exe (which should target .Net 2.0).
In both cases, I was able to verify that fsi is now using the 2.0 binaries, but for some reason I'm having "display" problems. My experience is such that I can't seem to see what I'm typing initially (i might be typing String.split;; but what I see echoed
might be .split;; and fsi gets as input "tring.split;;). I have a really fast MacBook (Intel dual-core) and 4 Gig of RAM so I'm sure the problems are being caused by something else. unfortunately, i dont know what those are :-(

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ mono bin/fsi.exe --no-gui
MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.3.14, compiling for .NET Framework Version v2.0.50727
NOTE: 
NOTE: See 'fsi --help' for flags
NOTE: 
NOTE: Commands: #r <string>;;    reference (dynamically load) the given DLL. 
NOTE:           #I <string>;;    add the given search path for referenced DLLs. 
NOTE:           #use <string>;;  accept input from the given file. 
NOTE:           #load <string> ...<string>;;
NOTE:                            load the given file(s) as a compilation unit.
NOTE:           #time;;          toggle timing on/off. 
NOTE:           #types;;         toggle display of types on/off. 
NOTE:           #quit;;          exit. 
NOTE: 
NOTE: Visit the F# website at http://research.microsoft.com/fsharp.
NOTE: Bug reports to fsbugs@microsoft.com. Enjoy!
> .split;;
  tring.split;;
  ^^^^^^
stdin(1,0): error: FS0039: The namespace or module 'tring' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> Striing.map;;
  Striing.map;;
  ^^^^^^^^
stdin(2,0): error: FS0039: The namespace or module 'Striing' is not defined.
stdin(0,0): error: FS0039: The value or constructor 'it' is not defined.
stopped due to error
> String.map;;
val it : ((char -> char) -> string -> string) = <fun:clo@0>
> #quit;;
- Exit...
By on 1/27/2008 4:38 PM ()

something strange ...

I tried other functions in Microsoft.FSharp.Core.String and did not encounter any problem:

1
2
3
4
> String.for_all;;
val it : ((char -> bool) -> string -> bool) = <fun:clo@0>
> String.map;;
val it : ((char -> char) -> string -> string) = <fun:clo@0_1>

but

1
2
3
4
5
> String.Split;;
  String.Split;;
  -------^^^^^^
stdin(5,7): error: FS0039: The value, constructor, namespace or type 'Split' is not defined.
stopped due to error
By on 1/27/2008 10:31 AM ()

I wonder if

open System;;

would help ?

By on 1/27/2008 10:44 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper