From 212c2cdf2fe267d1e12f936796e0805325b65fad Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 29 Nov 2016 00:09:22 +0900 Subject: [PATCH] robot-name: Fix hlint-1.9.38 newtype warning Patch example solution to fix the warning: ``` ./exercises/robot-name/examples/success-standard/src/Robot.hs:7:1: Suggestion: Use newtype instead of data Found: data Robot = Robot{robotNameVar :: MVar String} Why not: newtype Robot = Robot{robotNameVar :: MVar String} Note: decreases laziness 1 hint (5 ignored) ``` The `nightly` snapshot currently fails the tests in Travis-CI because of that warning. --- exercises/robot-name/examples/success-standard/src/Robot.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/robot-name/examples/success-standard/src/Robot.hs b/exercises/robot-name/examples/success-standard/src/Robot.hs index 8ff39d24f..ef8539bb9 100644 --- a/exercises/robot-name/examples/success-standard/src/Robot.hs +++ b/exercises/robot-name/examples/success-standard/src/Robot.hs @@ -4,7 +4,7 @@ import Control.Concurrent (MVar, readMVar, swapMVar, newMVar) import Control.Monad (void) import System.Random (randomRIO) -data Robot = Robot { robotNameVar :: MVar String } +newtype Robot = Robot { robotNameVar :: MVar String } mkRobot :: IO Robot mkRobot = fmap Robot $ generateName >>= newMVar