Note: these instructions are for pre-Sierra MacOS. Sierra (10.12) and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow
If you are getting this in gdb on OSX while trying to run a program:
Note: these instructions are for pre-Sierra MacOS. Sierra (10.12) and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow
If you are getting this in gdb on OSX while trying to run a program:
Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.
This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.
Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you want to make something span exactly the height of the viewport, or pin something to the bottom of the screen, this can get tricky because the viewport changes size (or
While thinking about comonads as spaces and Day convolution, I realized an interesting thing. The free applicative functor generated by a comonad f
is also a comonad.
The free applicative can be defined in a few different ways, but I like to define it like this:
data FreeApplicative f a = Pure a | Free (Day f (FreeApplicative f) a)
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
-- | Nothing very serious. | |
-- | |
-- >>> 5 Years | |
-- Years 5 | |
-- |
module Component.Utils.Debounced where | |
import Prelude | |
import Data.Either as E | |
import Data.Foldable (traverse_) | |
import Data.Maybe (Maybe(..)) | |
import Effect.Aff.AVar as AVar | |
import Effect.Aff (Milliseconds, delay, forkAff, killFiber) | |
import Effect.Aff.Class (class MonadAff, liftAff) |
J. S. Choi, 2022
All programmers must manipulate text; JavaScript programmers are no exception. Text manipulation often refers to specific characters, usually by their code points in hexadecimal – or by embedding the characters directly in source code.
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE UnsaturatedTypeFamilies #-} | |
import GHC.TypeLits | |
import Prelude hiding (Functor, Semigroup) | |
type Main = (Fizz <> Buzz) <$> (0 `To` 100) |
-- This illustrates (most of) a new(?) encoding of ad-hoc polymorphism using | |
-- dependent types and implicits. | |
-- | |
-- Benefits of this approach: | |
-- • can have multiple “ambiguous” instances without requiring things like | |
-- Haskell’s newtypes to distinguish them; | |
-- • can disambiguate instances with minimal information, rather than having to | |
-- know some arbitrary instance name as you would with a system like Scala’s | |
-- implicits; | |
-- • implementers don’t need to know/provide the full family of instances – they |
Do not get bogged down in microoptimizations before you've assessed any macro optimizations that are available. IO and the choice of algorithm dominate any low level changes you may make. In the end you have to think hard about your code!
Before starting to optimize: