examples: use 'random' instead of 'probable' for GS9
This commit is contained in:
parent
e0f4ed6426
commit
4653744706
2 changed files with 6 additions and 5 deletions
|
@ -10,10 +10,10 @@ import Control.Monad.IO.Class
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Math.Probable
|
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Servant
|
import Servant
|
||||||
import Servant.JQuery
|
import Servant.JQuery
|
||||||
|
import System.Random
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Language.Javascript.JQuery as JQ
|
import qualified Language.Javascript.JQuery as JQ
|
||||||
|
@ -26,9 +26,10 @@ data Point = Point
|
||||||
instance ToJSON Point
|
instance ToJSON Point
|
||||||
|
|
||||||
randomPoint :: MonadIO m => m Point
|
randomPoint :: MonadIO m => m Point
|
||||||
randomPoint = liftIO . mwc $ Point <$> d <*> d
|
randomPoint = liftIO . getStdRandom $ \g ->
|
||||||
|
let (rx, g') = randomR (-1, 1) g
|
||||||
where d = doubleIn (-1, 1)
|
(ry, g'') = randomR (-1, 1) g'
|
||||||
|
in (Point rx ry, g'')
|
||||||
|
|
||||||
data Search a = Search
|
data Search a = Search
|
||||||
{ query :: Text
|
{ query :: Text
|
||||||
|
|
|
@ -25,7 +25,7 @@ executable getting-started
|
||||||
, http-types
|
, http-types
|
||||||
, js-jquery
|
, js-jquery
|
||||||
, lucid
|
, lucid
|
||||||
, probable
|
, random
|
||||||
, servant
|
, servant
|
||||||
, servant-docs
|
, servant-docs
|
||||||
, servant-jquery
|
, servant-jquery
|
||||||
|
|
Loading…
Reference in a new issue