See the new site: https://postgresisenough.dev
| open System | |
| /// A train carriage can have a number of different features... | |
| type Feature = Quiet | Wifi | Toilet | |
| /// Multiple classes | |
| type CarriageClass = First | Second | |
| /// Carriages can be either for passengers or the buffet cart | |
| type CarriageKind = |
Start with a fresh folder and copy a hapi.properties into it. It will be mounted into the container.
Carefully make sure your hapi.properties looks like this:
# add postgres
datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://db:5432/hapi
hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
datasource.username=admin
datasource.password=admin
| module Expr where | |
| data Expr a = Var a | Val Int | Add (Expr a) (Expr a) | |
| deriving Show | |
| instance Functor Expr where | |
| -- fmap :: (a -> b) -> Expr a -> Expr b | |
| fmap f (Var x) = Var $ f x | |
| fmap _ (Val n) = Val n | |
| fmap f (Add l r) = Add (fmap f l) (fmap f r) |
I suggest that you create one or more Api.fs files to expose F# code in a C# friendly way.
In this file:
- Define functions with
PascalCasenames. They will appear to C# as static methods. - Functions should use tuple-style declarations (like C#) rather than F#-style params with spaces.
Fable is an F# language to javascript compiler powered by Babel.
F# is a language that runs on a Microsoft CLR. Using the .NET Core CLR implementation it works on Windows, Mac or Linux.
- .NET Core SDK - download the latest 2.1 SDK
- Mono -
mono-completepackage - F# compiler -
fsharppackage from the mono repository
The following intructions can be used to install .NET Core on Linux ARM64.
Pro tip: Check out .NET Core Docker files to determine the exact instructions for installing .NET Core builds, for example .NET Core 3.1 ARM32 SDK Dockerfile.
The following instructions install the latest .NET Core globally. It isn't required to do that, but it provides the best experience.
| (* | |
| CapabilityBasedSecurity_ConfigExample.fsx | |
| An example of a simple capability-based design. | |
| Related blog post: http://fsharpforfunandprofit.com/posts/capability-based-security/ | |
| *) | |
| /// Configuration system | |
| module Config = |