GithubHelp home page GithubHelp logo

justusadam / marvin-interpolate Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 37 KB

Compile time String interpolation

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%
string-interpolation splice

marvin-interpolate's Introduction

Simple string interpolation

Travis Hackage

You can find the documentation for this library as part of the marvin docs on readthedocs.

marvin-interpolate's People

Contributors

justusadam avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

denibertovic

marvin-interpolate's Issues

Update to work with GHC 8.6

Hey @JustusAdam

On this line: https://github.com/JustusAdam/marvin-interpolate/blob/master/src/Marvin/Interpolate.hs#L107 we're not handling the empty list case.

I mentioned this to you earlier and it's because of this change: https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.6#MonadFailDesugaringbydefault

Basically we need to handle the [] case and not just the (name:rest) case.
This seems like a straightforward change except I'm not sure what we should do in [] case. If I just add [] -> error "foo" it compiles but it's not clear to me from the code what should really happen here. I've never worked with TH so the code is a bit of a mystery to me.

Ambiguous fixity with two infix operators in expression

interpolated expressions do not work if there are more than one infix operators, i.e. record ^. field1. field2

Fixities can be retrieved for in-scope bindings in template-haskell using reifyFixity. That doesn't work well with haskell-src-meta though, because it expects a list, not a lookup function.

A possible clean solution is not using haskell-src-meta all and instead asking the GHC library to do the parsing and then translate that to template haskell decls.

Originally reported in #2 and #3, similar issue found in ennocramer/floskell#9

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.