{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module Language.Futhark.Futlib (futlib, prelude) where
import Data.FileEmbed
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import qualified System.FilePath.Posix as Posix
import Futhark.Util (toPOSIX)
futlib :: [(Posix.FilePath, T.Text)]
futlib = map fixup futlib_bs
where futlib_bs = $(embedDir "futlib")
fixup (path, s) = ("/futlib" Posix.</> toPOSIX path, T.decodeUtf8 s)
prelude :: [String]
prelude = map ("/futlib/"++) ["prelude"]