Questions tagged [signature-files]

A signature file contains information about the public signatures of a set of F# program elements, such as types, namespaces, and modules. It can be used to specify the accessibility of these program elements.

For each F# code file, you can have a signature file, which is a file that has the same name as the code file but with the extension .fsi instead of .fs. Signature files can also be added to the compilation command-line if you are using the command line directly. To distinguish between code files and signature files, code files are sometimes referred to as implementation files. In a project, the signature file should precede the associated code file.

See MSDN.

10 questions
10
votes
1 answer

Automated F# Signature File (.fsi) Generation

I am working on a project that has a number of modules that I'd like to apply access control constraints to. I'd also like to have my project contain additional documentation on the type signatures of each function. I know that I can accomplish…
Impl0x
  • 103
  • 5
9
votes
1 answer

Signature Files and Access Modifers in F#

I've recently been trying to learn the Object-Oriented aspects of F#, and have become curious about how to restrict access to types/modules in the language. More specifically, I want to know the difference between writing this: Example.fsi module…
Noldorin
  • 144,213
  • 56
  • 264
  • 302
2
votes
1 answer

F# signature file error

I was trying to use a fsi file to allow mutually recursive classes in separate files, but my fsi file did not compile. Below is a simple example which demonstrates the problem. File program.fs: module mod1 type first = |zero = 0 File…
John Palmer
  • 25,356
  • 3
  • 48
  • 67
2
votes
1 answer

f#: Signature file causing Intellisense to complain?

Given the following code... type IMyInterface = abstract BoolA : bool abstract BoolB : bool let myFn _boolVal (_i: IMyInterface) = if _boolVal then _i.BoolA else _i.BoolB let myFnTrue = myFn true let myFnFalse = myFn false ... Intellisense…
MiloDC
  • 2,373
  • 1
  • 16
  • 25
1
vote
0 answers

when does Apache felix perform signature verification of a OSGI bundle .jar file?

we have a command in apache felix to install an OSGi bundle i.e "felix:install Jar-file". My query is :Does this command also perform verification(before installing) of contents of jar-file against the signature with which it was signed earliar? Or…
1
vote
1 answer

How to inherit from an abstract class in an fsharp signature file?

I am trying to model a domain in FSharp. And I would like client code to experience clean access to these types. So part of it is by creating a signature file (.fsi), which is described here:…
1
vote
1 answer

F# denies existence of a constructor (probably type-constraint related)

On the following code, F sharp says: module xyz requires a value new : (IBlah<'a> * 'b) -> test<'a, 'b>') I have tried supplying that exact constructor as an explicit new but it did not seem to help, though Intellisense though the type was the…
Joe Huha
  • 548
  • 3
  • 16
1
vote
2 answers

Generic function definitions in F# signature files and corresponding implementation file

I'm trying to create an abstraction for a lightweight data storage module using an F# signature file. Here is my signature file code, let's say it's called repository.fsi namespace DataStorage /// Lightweight Repository…
cameron
  • 81
  • 6
0
votes
0 answers

F# - signature file and implementation are not compatible: "The respective type parameter counts differ"

I am trying to write a library which implements an avl tree and I have organized all the code in a signature file and an implementation file. the problem arises when the interpreter gets to this function: //signature file: ... type AvlT<'a,'b when…
0
votes
1 answer

F# generic types

I am trying to use generics in an F# signature file, but I am having some troubles with the implementation. this is the content of the signature file: module BalancedBST type 'a BalancedBST val add : 'a -> 'a BalancedBST -> 'a BalancedBST …