>>> insert (-1) [1, 2, 3] [-1,1,2,3]
>>> insert 'd' "abcefg" "abcdefg"
>>> insert 4 [1, 2, 3, 5, 6, 7] [1,2,3,4,5,6,7]
insert 5 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'x')] insert 7 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'a'), (7, 'x')] insert 5 'x' empty == singleton 5 'x'
insert 5 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'x')] insert 7 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'a'), (7, 'x')] insert 5 'x' empty == singleton 5 'x'
>>> HashSet.insert 1 HashSet.empty fromList [1]
insert 5 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'x')] insert 7 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'a'), (7, 'x')] insert 5 'x' empty == singleton 5 'x'
insertJohn :: MonadIO m => ReaderT SqlBackend m (Key User) insertJohn = insert $ User "John" 30
johnId <- insertJohnThe above query when applied on dataset-1, will produce this:
+-----+------+-----+ |id |name |age | +-----+------+-----+ |1 |SPJ |40 | +-----+------+-----+ |2 |Simon |41 | +-----+------+-----+ |3 |John |30 | +-----+------+-----+
ghci> :set -XOverloadedStrings ghci> let hdrs = H.insert "Accept" "text/plain" $ H.empty ghci> hdrs H {unH = [("accept","text/plain")]} ghci> H.insert "Accept" "text/html" $ hdrs H {unH = [("accept","text/plain,text/html")]}