Giter Site home page Giter Site logo

example-servant-elm's People

Contributors

andreas-ebot7 avatar andys8 avatar franklinchen avatar soenkehahn avatar yoshmiru avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-servant-elm's Issues

Update Dependencies

I started to get this example running. Elm is in Version 0.17, not 0.18. When I tried to update elm I recognised the Api code is generated by elm-export and servant-elm. I think I could help update the elm code. The haskell server part is not too straight forward to update because there seem to be more breaking changes:

server/src/Api.hs:37:10: error:
    • No instance for (ElmType Integer)
        arising from a use of ‘elm-export-0.6.0.1:Elm.Type.$dmtoElmType’
    • In the expression: elm-export-0.6.0.1:Elm.Type.$dmtoElmType @Item
      In an equation for ‘toElmType’:
          toElmType = elm-export-0.6.0.1:Elm.Type.$dmtoElmType @Item
      In the instance declaration for ‘ElmType Item’
make[1]: *** [Api.elm] Error 1
make: *** [client-build] Error 2

Would be awesome if this example could be updated and work again.

Get type error for server

I got a type error when I try to make it run. I checked the Network.Wai.MakeAssets you were using and it returns IO Application as well. Not sure how your example works.

      Expected type: IO (Server WithAssets)
        Actual type: IO (Server Api :<|> Application)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}

module App
    ( startApp
    ) where

import Control.Concurrent
import Control.Monad.IO.Class
import Control.Monad.Trans.Except
import Network.Wai
import Network.Wai.MakeAssets
import Network.Wai.Handler.Warp
import Servant

import Api

type WithAssets = Api :<|> Raw

withAssets :: Proxy WithAssets
withAssets = Proxy

startApp :: IO ()
startApp = run 8080 =<< app

app :: IO Application
app = serve withAssets <$> server

server :: IO (Server WithAssets)
server = do
  assets <- serveAssets def
  return $ apiServer :<|> assets

apiServer :: Server Api
apiServer = return users

users :: [User]
users =
  [ User "Isaac Newton"    372
  , User "Albert Einstein" 136
  ]

No cabal found

Hello, i'm having this error when running make:

$ make
(cd client ; elm package install -y)
Packages configured successfully!
stack setup
stack will use a locally installed GHC
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
stack test --only-dependencies
No .cabal file found in directory /project-path/example-servant-elm/
make: *** [server-setup] Error 1

don't we need a cabal for the haskell package to use stack?

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.