-
Move Heist.SpliceAPI to map-syntax (https://github.com/mightybyte/map-syntax)
-
Add namespace support to heist
This means that users will be able to specify a namespace under which Heist will operate. If the user specifies a namespace of "h", then the splice '"foo" ## fooSplice' will match the tag <h:foo>. This alone doesn't give us much benefit. But on top of that we will add checking so Heist will throw an error if it encounters any <h:...> tag that does not have a splice bound for it. This will be a big help in finding bugs caused by not having a splice bound.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utcTimeFormlet :: Monad m | |
=> String | |
-- ^ Date format string | |
-> String | |
-- ^ Time format string | |
-> TimeZone | |
-> Formlet Text m UTCTime | |
utcTimeFormlet dFmt tFmt tz d = | |
localTimeToUTC tz <$> localTimeFormlet dFmt tFmt (utcToLocalTime tz <$> d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- image: http://i.imgur.com/567RLZ2.png | |
squiggle :: Path V2 Double | |
squiggle = rotate ((-1)/4 @@ turn) $ metafont $ | |
(4 ^& 1) .--. | |
(10 ^& 4) .--. | |
(15 ^& 5.2) .--. | |
(20 ^& 5) .--. | |
(25 ^& 3) .--. | |
(30 ^& 1.5) .--. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RecursiveDo #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
------------------------------------------------------------------------------ | |
import Control.Concurrent | |
import Control.Monad | |
import Control.Monad.Trans |
I hereby claim:
- I am mightybyte on github.
- I am mightybyte (https://keybase.io/mightybyte) on keybase.
- I have a public key whose fingerprint is E354 4097 9E03 BC59 CC6F 444A 0272 6879 EA3E 9B28
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data WidgetConfig t a | |
= WidgetConfig { _widgetConfig_setValue :: Event t a | |
, _widgetConfig_initialValue :: a | |
, _widgetConfig_attributes :: Dynamic t (Map String String) | |
} | |
makeLenses ''WidgetConfig | |
instance (Reflex t, Default a) => Default (WidgetConfig t a) where | |
def = WidgetConfig { _widgetConfig_setValue = never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dist/build/cabal/cabal gen-bounds | |
Resolving dependencies... | |
The following packages need bounds and here is a suggested starting point. | |
You can copy and paste this into the build-depends section in your .cabal | |
file and it should work (with the appropriate removal of commas). | |
Note that version bounds are a statement that you've successfully built and | |
tested your package and expect it to work with any of the specified package | |
versions (PROVIDED that those packages continue to conform with the PVP). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------------------------------ | |
-- | Gets the current path of the DOM Window (i.e., the contents of the | |
-- address bar after the host, beginning with a "/"). | |
-- https://developer.mozilla.org/en-US/docs/Web/API/Location | |
getWindowLocationPathname :: DOMWindow -> IO String | |
#ifdef ghcjs_HOST_OS | |
getWindowLocationPathname w = do | |
jw <- toJSRef w | |
liftM fromJSString $ js_windowLocationPathname jw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app :: MonadWidget t m => App t m () | |
app = do | |
ti <- textInput $ TextInputConfig "range" "4" never | |
(constDyn $ "min" =: "1" <> "max" =: "6") | |
n <- holdDyn (4::Int) (read <$> updated (value ti)) | |
let f = reflexDia (def & sizeSpec .~ D.mkSizeSpec2D (Just 600) (Just 600)) . example | |
el "div" $ widgetHoldHelper f 4 (updated n) | |
return () | |
hilbert 0 = mempty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getArgs :: Type -> [Type] | |
getArgs (ForallT _ _ t) = getArgs t | |
getArgs (SigT t _) = getArgs t | |
getArgs (AppT (AppT ArrowT a) b) = a : getArgs b | |
getArgs b = [b] | |
-- Possible lens version | |
prismCase [ _ForallT . _3 :-> getArgs, _SigT . _1 :-> getArgs, _AppAppArrow :-> \(a,b) -> a : getArgs b, id :-> \b -> [b] ] |