Skip to content

kelecorix/inline-clr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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
    |]