/inline-clr

C# / F# interop with Haskell modules via inlining

MIT LicenseMIT

inline-clr

inline-clr provides a quasiquoter to inline C# and F# code in Haskell modules. Inspired by inline-c, inline-r and inline-java.

Examples

{-# LANGUAGE DataKinds   #-}
{-# LANGUAGE QuasiQuotes #-}

module Main where

import Data.Int (Int32)
import Data.String (fromString)
import Foreign.CLR (withCLR)
import Language.CLR.CSharp.Inline
import System.Environment (getArgs)

main :: IO Int32
main = do
  args <- getArgs
  withCLR (map fromString args) $ 
    [csharp|
     -- C# code goes here
    |]