Can haskell grouping function be made similarly like that?
<p>Is it possible to somehow make group function similarly to that:</p>

<pre><code>group :: [Int] -&gt; [[Int]]
group [] = []
group (x:[]) = [[x]]
group (x:y:ys)
    | x == y = [[x,y], ys]
    | otherwise = [[x],[y], ys]
</code></pre>

<p>Result shoult be something like that:</p>

<pre><code>group[1,2,2,3,3,3,4,1,1] ==&gt; [[1],[2,2],[3,3,3],[4],[1,1]]
</code></pre>

<p>PS: I already looked for Data.List implementation, but it doesn't help me much. (<a href="https://hackage.haskell.org/package/base-4.3.1.0/docs/src/Data-List.html" rel="nofollow">https://hackage.haskell.org/package/base-4.3.1.0/docs/src/Data-List.html</a>)</p>

<p>Is it possible to make group funtion more clearer than the Data.List implementation?</p>

<p>Or can somebody easily explain the Data.List implementation atleast?</p>