Skip to content

Instantly share code, notes, and snippets.

View saevarb's full-sized avatar

Sævar Berg saevarb

  • NTT Data BS Nordics
  • Odense, Denmark
View GitHub Profile
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Control.Monad.State
import Control.Monad.Except
import Control.Applicative
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Control.Monad.State
import Control.Monad.Except
import Control.Applicative
-- code
parseEventPayload :: forall opcode event. Sing opcode -> Sing event -> Value -> Parser (Payload opcode event)
parseEventPayload SHello SNothing val =
HelloPayload <$> parseJSON val
parseEventPayload SDispatch (SJust SREADY) val =
ReadyPayload <$> parseJSON val
parseEventPayload SDispatch (SJust SCHANNEL_CREATE) val =
ChannelCreatePayload <$> parseJSON val
parseEventPayload SDispatch (SJust SCHANNEL_UPDATE) val =
ChannelUpdatePayload <$> parseJSON val
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE QuasiQuotes #-}
module PluginTest where
import Control.Monad
import Data.Aeson
{-# LANGUAGE AllowAmbiguousTypes #-}
module Plugins where
import Control.Monad
import Data.Aeson
import Data.Aeson.Types
import GHC.Generics
data EventType
= FooEvent
module Foo where
import System.Random
data Tree a
= Tree a (Tree a) (Tree a)
| Leaf
deriving (Functor, Foldable, Traversable, Show)
Figwheel: Cutting some fruit, just a sec ...
Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid ;)
Figwheel: Starting server at http://0.0.0.0:3449
Figwheel: Watching build - dev
Compiling "resources/public/js/compiled/app.js" from ["src/cljs"]...
WARNING: Use of undeclared Var clojure.walk/defn at line 37 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs
WARNING: Use of undeclared Var clojure.walk/walk at line 37 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs
WARNING: Use of undeclared Var clojure.walk/inner at line 44 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs
WARNING: Use of undeclared Var clojure.walk/outer at line 44 file:/home/sbrg/.m2/repository/org/clojure/clojurescript/1.9.946/clojurescript-1.9.946.jar!/clojure/walk.cljs
// axios is installed via `yarn add axios`, so I'm not entirely sure if this is needed.
// import axios from 'axios';
// The auto-generated functions all have this form
var getUser = function()
{
return axios({ url: '/user'
, method: 'get'
// axios is installed via `yarn add axios`, so I'm not entirely sure if this is needed.
// import axios from 'axios';
// This doesn't seem to work either
// function getUser()
// {
// return axios({ url: '/user'
// , method: 'get'
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Data.Proxy
data UTCTime
data ID a
data GenTable a
data Connection