ghc-api Questions

1

Solved

I have an application where, for various reasons, I need to run arbitrary, user supplied code. (SafeHaskell makes this nice and secure). I've looked at the plugins package, which is really nice for...
Calliope asked 14/12, 2013 at 4:14

1

Solved

I want to compile a Haskell module to GHC Core, with optimisations applied, and use the resulting core output. However, when I use compileToCoreSimplified it doesn't seem to run all the normal opti...
Basset asked 20/6, 2018 at 20:56

1

I need to have something like -- Main.hs module Main where main :: IO () main = do <import Plugin> print Plugin.computation With a Plugin like -- Plugin.hs module Plugin where computa...
Anemology asked 6/12, 2017 at 17:54

1

Solved

I'm looking for ways how to convert a simple Haskell program (no imported libraries, just data types and pure functions) into a term of the untyped lambda calculus. A promising approach seems to be...
Metalline asked 24/12, 2014 at 10:5

2

The Idea Hello! I want to create a program, that will generate Haskell Core and will use GHC API to compile it further into an executable. But before I will do it I want to construct a very basic ...
Oliviero asked 21/1, 2015 at 4:34

1

Solved

I'm trying to dynamically compile and load Haskell modules using GHC API. I understand the API fluctuates quite a bit from on one version to another so I'm specifically talking about GHC 7.6.*. I ...
Labradorite asked 29/5, 2013 at 5:55

1

Solved

I need a (quick and dirty) way to get some representation of the type of a Haskell expression that is given as a string. I currently see 3 options: Use GHC API -- however, the documentation lose...
Allison asked 4/5, 2013 at 11:6

2

Solved

Is it possible to generate and run TemplateHaskell generated code at runtime? Using C, at runtime, I can: create the source code of a function, call out to gcc to compile it to a .so (linux) (or...
Pourboire asked 22/1, 2013 at 13:22

1

Following the GHC tutorial posted here and alterations to this code following the advice in a previous stack overflow question I asked, I have created a program which is able to compile and run a m...
Our asked 8/10, 2012 at 22:26

1

Solved

I'm trying to make a program that typechecks haskell files for me using the GHC API. I've gotten the type checking to work for local files, but I have a specific cabal package that I need to be hav...
Yen asked 3/9, 2012 at 10:59

1

Solved

Suppose I have an arbitrary module module Foo where foo :: Moo -> Goo bar :: Car -> Far baz :: Can -> Haz where foo, bar, and baz are correctly implemented, etc. I'd like to reify this...
Hexateuch asked 20/7, 2012 at 1:7

1

Solved

I have the following code that uses the GHC API to load modules and get the type of an expression: typeObjects :: [String] -> [String] -> IO [Type] typeObjects modules objects = do defaultE...
Massey asked 11/2, 2012 at 18:48

2

Solved

I have an existing Haskell function that uses the GHC API to dynamically load compiled code from a module. It is based on the code from the blog post Dynamic Compilation and Loading of Modules in H...
Horta asked 8/2, 2012 at 17:11

2

Solved

I want to test the implementation a compiler optimization by piggybacking into the GHC compilation process and altering its Core representation. The idea would be to have something like: runGhc (J...
Felicity asked 5/10, 2010 at 14:42

2

Solved

I would like to create a frontend for a simple language that would produce GHC Core. I would like to then take this output and run it through the normal GHC pipeline. According to this page, it is ...
Supercharge asked 19/1, 2012 at 13:40

2

Solved

The GHC API requires that some initialisation occurs before invocation. Specifically, parseStaticFlags can only be called once. I have functions that can call runGhc :: MaybeFilePath :: Ghc a -&gt...
Walcott asked 27/6, 2011 at 4:52

2

Solved

I have a module Target, with a function Target.accessMe inside it. I compile this module in some way, then get rid of the source code. Now, what series of arcane incantations must I do to make a d...
Beitnes asked 2/4, 2011 at 4:22

1

Solved

I want to deploy an application on Windows that needs to access the GHC API. Using the first simple example from the Wiki: http://www.haskell.org/haskellwiki/GHC/As_a_library results in the follo...
Arc asked 18/3, 2011 at 17:47

3

Solved

For a tool I'm writing ( http://hackage.haskell.org/package/explore ) I need a way to read haskell function definitions at run-time, apply them to values from my tool and retrieve the results of th...
Walkon asked 16/3, 2010 at 0:12

4

Solved

I'm working on a project for analyzing Haskell code. I decided to use GHC to parse the source and infer types rather than write my own code to do that. Right now, I'm slogging through the Haddock d...
Carce asked 11/2, 2010 at 7:52
1

© 2022 - 2024 — McMap. All rights reserved.