From 812717522ee11b2655ec11b0fcb112735aa9d81f Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Fri, 29 Jul 2016 18:20:35 +0430 Subject: [PATCH] refactor(&&&): use &&& instead of the arrow function --- src/Sibe/NaiveBayes.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Sibe/NaiveBayes.hs b/src/Sibe/NaiveBayes.hs index 54348cb..531702e 100644 --- a/src/Sibe/NaiveBayes.hs +++ b/src/Sibe/NaiveBayes.hs @@ -16,6 +16,7 @@ module Sibe.NaiveBayes import qualified Data.Set as Set import Data.List.Split import Data.Maybe + import Control.Arrow ((&&&)) type Class = Int data Document = Document { text :: String @@ -54,7 +55,7 @@ module Sibe.NaiveBayes createDocuments classes content = let splitted = splitOn (replicate 10 '-' ++ "\n") content - pairs = map (\a -> ((head . lines) a, (concat . tail . lines) a)) splitted + pairs = map ((head . lines) &&& (concat . tail . lines)) splitted documents = map (\(topic, text) -> Document text (fromJust $ elemIndex topic classes)) pairs in documents