Skip to content

Instantly share code, notes, and snippets.

View geraldus's full-sized avatar
🎯
Focusing

Артур Файзрахманов geraldus

🎯
Focusing
  • Russian Federation
View GitHub Profile
@geraldus
geraldus / DynLoad.hs
Created February 25, 2022 15:01 — forked from worldsayshi/DynLoad.hs
Example for loading Haskell source code dynamically using the GHC api
-----------------------------------------------------------------------------
-- | Example for loading Haskell source code dynamically using the GHC api
-- Tested on ghc 7.4.2
--
-- Useful links:
-- GHC api:
-- http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/GHC.html
-- Wiki:
-- http://www.haskell.org/haskellwiki/GHC/As_a_library
-----------------------------------------------------------------------------
@geraldus
geraldus / Auth.hs
Created October 22, 2018 13:51
Could not deduce constraint
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Local.Auth.Plugin
( PrizmAuthPlugin(..)
, authPrizm
, loginR ) where
@geraldus
geraldus / CouldNotDeduce.hs
Created October 22, 2018 13:45
Could not deduce constraint
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
module Local.Auth.Plugin
( PrizmAuthPlugin(..)
, authPrizm
, loginR ) where
@geraldus
geraldus / op.hs
Created January 14, 2016 17:49
Haskell Unicode Operators
module TopLevel (module Level1, module Level2.Level2) where
import Level1
import Level2.Level2
-- ASCII syms
(..--) = undefined :: ()
(..-+) = undefined :: ()
(..++) = undefined :: ()
@geraldus
geraldus / Chunks.hs
Last active September 15, 2015 09:46
MFlow code example
data AppFlow
= Navigate SiteSection
| Shop ShopAction
| Admin AdminAction
| Authenticate String
data AdminAction
= CreateCategory ProductCategory
| AdminAction {- other actions, not implemented yet -} deriving (Show)
---------------------------------------------------------------
@geraldus
geraldus / Transient-I.md
Created July 15, 2015 10:19
A monad for reactive programming. Part 1

For the impatient: you can find something runnable at the bottom.

Functional reactive programming has no notion of event scope. A functional, declarative, reactive computation is affected as a whole by a signal, and must re-start from the beginning in some way, since it is declarative. A monad can contain the scope of the signal, so part of the computation already done upstream could be kept when a signal is injected at some level of the computation by an active component.

A monad can decompose the computation in a chain of event handlers virtually set

newtype TransientElement = TransientElement
{ unTransientElement :: ElementPrim }
data ElementPrim = ElementPrim
{ ref :: JSRef Element
, emap :: TMVar (M.HashMap String (TChan JSEvent))
, capture :: String -> IO JSEvent }
data Element = Element
data Event = Event
@geraldus
geraldus / Pitanie.md
Last active November 11, 2016 21:14
Питание

Питание

Основные принципы питания:

  • Питание должно быть раздельным
  • Питание должно способствовать очистке организма

Опишу саму систему, если будут вопросы — задавай, на всё, что смогу, отвечу.

Категорически исключить из пищи: