Coder Social home page Coder Social logo

fragnix's Issues

Layout signature fragment directly above binding declaration

We get slices like this, which is ugly

{-# LANGUAGE NoImplicitPrelude #-}
module F7007818387610957033 where
import F8137826209908809703 (deepseq)
import F2127085270274173167 (NFData)

infixr 0 $!!
f $!! x = x `deepseq` f x

($!!) :: (NFData a) => (a -> b) -> a -> b

Not online

There should be a repository online where many slices are hosted.

Packages with dependencies

package-modules does not work on packages with dependencies. It uses cabal install with our custom haskell-modules compiler. But this compiler does not implement a proper package database. Two possible directions to fix this are:

  • get rid of cabal install (but we need it for dependency resolution)
  • implement a package database.
  • reuse haskell-suite's implementation of a package database

Language Extensions

A lot of Haskell code is not actually written in Haskell but uses one or more of the extensions that GHC provides. We need to keep track of that on a per slices basis to be able to compile.

Group type signature and function definition.

Type signatures are just declarations, but we need to find a way to associate them to the function body.
A type signature can specify the type of many symbols and therefore many functions at once. In this case we should split it.

Mentioned values in type signatures

We only extract mentioned symbols from QNames. The symbols in TypeSigs are never qualified and therefore Names. A nice fix would be to convince the people at haskell-src-exts to make these names QNames.

First class instances

We want to reliably find out what class and type an instance is for. Right now we only find out the class as all mentioned class symbols which clearly is a bug. We could have a special instance symbol.
Needed for #36.

Slice tester

We want a script to attempt to compile all slices and summarize the results

Tests for the entire pipeline.

Now that the pipeline from module files to compiled program works we need the infrastructure to test module files with more and more features.

More tests

Write a few more tests for the entire pipeline and the individual steps

Actually compute hash

The resolver currently assigns temporary IDs to slices. We need to compute a hash of each slice and replace all temporary IDs.

Mutually recursive declarations are not supported

Mutually recursive declarations make problems in different phases:

Extraction: We need to detect cycles
Hashing: We cannot compute the hash without knowing it first
Compilation: We need hs-boot files for mutually recursive modules

Probably mutually recursive declarations have to be grouped into one slice.

Find a way to put instances into their own slice

We put every instance into its own slice. The problem is that the instance depends on both the class it is of and the type it is for. When compiling we would have to import the instance in either one so that it is propagated. But this leads to cyclic imports. Maybe instances really need their own very special treatment.

Cpp problems with infix \\

There is a strange bug with infix declarations for \ and CPP. The workaround is

infixl 9 \\{-This comment teaches CPP correct behaviour -}

Type class instances

We need to find a good heuristic for when a declaration does or does not depend on a type class instance.

Safe Haskell is in the way

Sometimes we have Safe and/or Trustworthy pragmas that somehow prevent compilation. As an easy fix we could ignore them when assembling the comilation units.

Separate declaration extraction and slice extraction

We want three tools:
package-declarations: given a package extracts all declarations from it
module-declarations: given a set of modules extracts all declarations from them
declarations-slices: given a set of declarations finds all slices

Dependency on instances

We need an extra case for UsedName where the name should be empty and we are using an instance.

Operator symbols not working properly

In F5685558312108961428.hs:

{-# LANGUAGE NoImplicitPrelude #-}
module F5685558312108961428 where
import GHC.Arr (!)
import F4889493513583856799 (vertices)
import F4140369130282544907 (Edge)
import F4001183171300763828 (Graph)
edges g = [(v, w) | v <- vertices g, w <- g ! v]

edges :: Graph -> [Edge]

The import of ! should be import GHC.Arr ((!))

Flatten fragnix/builtin module names

The names of the symbol files in fragnix/builtin are hierarchical and not flat as opposed to the ones in fragnix/names. Write a one time script to flatten them.

Slice explorer

We want a web app to explore a folder full of slices. Viewing them in an editor is tedious.

Extract module sources in separate step

package-declarations takes the name of a package and produces fragnix/names and fragnix/declarations. There should be two different steps instead: package-modules takes a package and yields perfect, preprocessed, parseable Haskell module files. Then module-declarations takes these modules, does name resolution and extracts the declarations.

Own names database

We currently use the global names database that comes with haskell-names. Going further we will want our own database in fragnix/names for easy distribution and better control.

Command line executable.

The path of the file fragnix is invoked on is currently hard-coded. We want to take it on the command line. Eventually we want to take an entire folder (after #5 is resolved). We also want some output to indicate progress and nice error messages.

List builtin symbols

We need a list of all symbols that are considered builtin for name resolution and for classifying references during slice generation. We currently have builtin modules in fragnix/builtin. Related to #20.

Depend on names in instance constraints

Part of #4 is to properly extract used names in instance constraints. Fails to compile:

{-# LANGUAGE NoImplicitPrelude #-}
module F1979410200377991118 where
import GHC.Arr (bounds)
import GHC.Arr (elems)
import GHC.Arr (Array)
import F5363716782726002741 (NFData)
import F5363716782726002741 (rnf)

instance (Ix a, NFData a, NFData b) => NFData (Array a b) where
        rnf x = rnf (bounds x, Data.Array.elems x)

Something goes wrong with type operators

The following does not compile:

{-# LANGUAGE NoImplicitPrelude #-}
module F5030602782144409221 where
import GHC.Prim (seq)
import Data.Complex (Complex(:+))
import Data.Complex (Complex)
import F5363716782726002741 (NFData)
import F5363716782726002741 (rnf)

instance (RealFloat a, NFData a) => NFData (Complex a) where
        rnf (x :+ y) = rnf x `seq` rnf y `seq` ()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.