GithubHelp home page GithubHelp logo

rpeszek / graphplay Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 354 KB

Polymorphic graph ideas in Haskell

License: Other

Haskell 100.00%
examples functional-programming haskell wiki graph literate-programming

graphplay's Introduction

GraphPlay

Library which uses directed and undirected graphs as an excuse to play with Haskell polymorphism.

GraphPlay uses CamelCase to purposefully not follow hackage-package naming convention. It is intended as learning and experimentation playground with cabal let's have it all attitude. It is not a production library.

Here is what is in the library:

  • Type classes with functional dependencies defining
    • read only graphs
    • buildable graphs
    • adjustable graphs
  • Some graph folding and traversal algorithms.
  • Examples with polymorphic data production, polymorphic morphisms from one type into another etc. Just because it is so much different than OO
  • Examples of Free DSL-Interpreter design pattern (Traversals, Walks)
    • using monadic interpreters
    • composable Free-Cofree pattern

And there are lots of plans for the future:

  • More Free DSL-Interpreter Stuff, prisms etc.
  • Play with Effects
  • GADT

Play Folder is separate from standard 'src' and 'test'.
That folder contain files that demo the library and my experiments. I am re-working these as literate programs (lhs).

Wiki Each lhs program is markdown to a file and checked in to this project wiki pages for easy reading.
I think of literate programs as better versions of blog posts. I love FP and Haskell and maybe my affection will become more contagious with these little program examples. The goal is to make these play folder examples readable without knowing much about Haskell with focus on what can be done more than how it is done.

To play with this project:

git clone https://github.com/rpeszek/GraphPlay.git
cd GraphPlay
stack build
stack build --test

or

stack ghci
stack ghci --test

and

:l various play/test files.

My first more sizable Haskell project! Learning a TON and having lots of fun.

graphplay's People

Contributors

rpeszek avatar

Watchers

 avatar  avatar

Forkers

henrylaxen

graphplay's Issues

Update code to run with ghc-8.10.7

Hi Robert,
I was looking around for examples of Free Monads and stumbled across this repository. When I tried to compile it, I got quite a few compiler errors, mostly relating to MonadFail. Anyway I fixed them and got the code to compile. I tried (many times) to push my new code to a fork of your repository and always got:

remote: Permission to henrylaxen/GraphPlay.git denied to henrylaxen.
fatal: unable to access 'https://github.com/henrylaxen/GraphPlay.git/': The requested URL returned error: 403

This happened even after a generated a new token. I really don't know what is going on.
So I gave up, created a tgz file, and put it here
If you are interested, you can just download it. The files I changed were:

  "graphplay.cabal"
  "play/Deprecated/DiGraph/TreeMonoidFoldOnSimpleGraph.hs"
  "play/Play.hs"
  "play/S1_Cstr/E04_PolyToMax.lhs"
  "play/S2_Free/E03_BFS2.lhs"
  "src/FreeDSL/VWalk.hs"
  "src/FreeDSL/VWalk/InterpreterFold.hs"
  "src/FreeDSL/VWalk/InterpreterStd.hs"
  "src/PolyGraph/Common/RecursionHelpers.hs"
  "src/PolyGraph/ReadOnly/DiGraph/Fold/TAFold.hs"
  "src/PolyGraph/ReadOnly/DiGraph/Fold/TAMonoidFold.hs")

I hope this is helpful.
Best wishes,
Henry Laxen

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.